I am trying to setpup a cronjob that backups the server account but I wish to have it backup to a different directory instead of the default /backups
What I would like to do is have the backup script drop the backups in to a date stamped folder, example.
/backups/2020-09-30
Using the following command
~iworx/bin/backup.pex --domains all --output-dir /backups/$(date +%Y-%m-%d)/ --quiet --filename-format %D-%t-%b.%d.%Y --email myemail@gmail.com
It drops all backups into the / folder instead of the /backups/2020-09-30 folder also note if fails to create the 2020-09-30 folder as well.
I know I have to be doing something off, but darn if I can see it.
Please can someone point me in the correct direction.
Without having seen anything on the server (or the exact command you’re running), I would ensure that the cron user is able to access the /backups folder. I can’t imagine that would cause the script to drop the files in ‘/’ but rather just fail to write the files, but it’s good to just check those things out. If you want to put in a support request, we can look it over and try to find out what might be blocking that.
Yes, it was created as a cron at the command line. Found a problem - the server ran out of memory, after deleting previous backups in recent years, the problem disappeared.
Sorry for the delay, I still don’t have a reason as to why the commands did not work running as root, but I was able to write a small bash script that did the same thing and it worked.