[SPLIT] backup script

Status
Not open for further replies.

Dan

Moderator
@ Josh
Yes, it takes time to run any backups. Be sure to keep an eye on your disk usage at BQbackup too.

@ Paul
Thank you very much Paul! Although this also ends up giving us a user named "users" from the directory name. Can change this to
Code:
find /var/cpanel/users -type f -printf "%f\n" |[/quote] and that should fix it so will do! :)

@ Mylinear
This is the script that WHM backup calls to do it's backups.  Server load may or may not be the same, I don't know.  I know that it took a lot longer to backup when I used WHM backup than it does now.  And I know I frequently got disk space warnings for users when it ran too.  Perhaps it runs each backup as that user and now I am running it as root?  I don't know.  So I guess it comes down to control and being able to have a learning experience.  Something as basic and critical as backups I like to have control over.
 

khiltd

New Member
I would change this part:

Code:
cat /etc/passwd | awk -F':' '/\/home/ { print $1 }' |
to:

Code:
find /var/cpanel/users -printf "%f\n" |
I tend to do a lot of things behind cPanel's back that would break this, but that is certainly easier to read.
 

KH-Paul

CTO
Staff member
Dan - thanks, -type f is something that is definitely needed.

khiltd - it isn't only easier to read but also will reduce number of forks and will prevent execution of pkgacct for manually created system users that aren't in cPanel config but still have home directory under /home.
And, if /etc/passwd needs to be parsed, i would do it like this:
Code:
awk -F':' '/\/home/ { print $1 }' /etc/passwd |
 

khiltd

New Member
Dan - thanks, -type f is something that is definitely needed.

khiltd - it isn't only easier to read but also will reduce number of forks and will prevent execution of pkgacct for manually created system users that aren't in cPanel config but still have home directory under /home.
And, if /etc/passwd needs to be parsed, i would do it like this:
Code:
awk -F':' '/\/home/ { print $1 }' /etc/passwd |
True. I don't do anything with pkgacct, scp or this particular backup service myself, I just answered the immediate question of how to get a list of users ;)
 

Dan

Moderator
Sorry for going OT, but is anyone using S3 for backup? If yes, then which script are you using?
Hello Yogesh,

I took a quick look at Amazon's S3 is that what you are talking about? If so then I didn't spend a lot of time reading but it does not look like they give you SSH access although you do have FTP access right?
 
Status
Not open for further replies.
Top