SOLVED bash script for backup all user and save in specific directory

behinam

Well-Known Member
May 9, 2017
71
5
8
Dubay
cPanel Access Level
Root Administrator
I have a code for backup all user

Code:
for USER in /var/cpanel/users/*; do /scripts/pkgacct $USER ; done
now I want backup to generate in a specific directory like /backup
I know I should use DIRECTORY or $destination options, but how can add this option in my code?
 
Last edited by a moderator:

behinam

Well-Known Member
May 9, 2017
71
5
8
Dubay
cPanel Access Level
Root Administrator
when i run script i give this error:

Unable to get user id for user “/var/cpanel/users/mrarzani”
Usage:
/usr/local/cpanel/bin/pkgacct [options] user [workdir]

user = the user to package
workdir = the directory to put the package
 

andrew.n

Well-Known Member
Jun 9, 2020
519
138
43
EU
cPanel Access Level
Root Administrator
Hello,

As the script say you can specify the workdir like:

/scripts/pkgacct $USER /backup

You can find more info about the available options here: