This is the cron command:
/usr/bin/nice -n 19 /usr/bin/mysqldump -u $USER --password=$PASSWORD
$DATABASE -c | /usr/bin/nice -n 19 /bin/gzip -9 >
a. First about the program-needs of the cronjob.
I myself have DirectAdmin, a very common used program (a program by the way
you never can choose yourself). The manual should state in which way the
command needs to be crosschecked with the program (which arguments are
program-depended, which not; likewise: which arguments are user-dependent).
I have doubts about:
* /usr/bin/nice (nice?)
It's nice program. I see here a /bin/nice but not a /usr/bin/nice
* 19 and 9 (is this really correct?)
Yes. nice -n 19 lowers the priority to 19 (lowest).
gzip -9 uses best compression-
* -u $USER
is this the user in the reseller account or the username of the database?
The username for the db
in DirectAdmin only the resellers account can make a
cronjob, and therefore
the user in question should be stated, otherwise it makes a backup of the
should USER be replaced by the username of the account, or the domainname
(or the $ as well?)
The username for the db, also replace the $
should you make the directory yourself and where should it be placed (not
sure about the ~)
The ~ expands to your home. ~/backup/ is a folder in your home (yes,
make it yourself). You can provide another location if you want.
where should I find the backupfile if it's working
properly (I think in the
In the backup folder.
* can the command line always find the database?
or should there be a check of some sort?
Well, for example, you could have permission errors. But if it works the
first time, it will continue working. Plus, when you have a number of
backups an error would produce a file much smaller.
b. user dependent
* replace PASSWORD with the database password (or the $ as well?)
* replace DATABASE with the username of the database (true?)
* replace the second DATABASE ? or is it just the name of the file
Replace all $DATABASE with the database name
Replace $USER with the db user.
Replace $PASSWORD with the db password.