Backups Change Output Directory

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.

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 [email protected]

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.

Thank you,

Hi Anthony

Welcome to IW forums

I know backups have been talked about on the forums many times.

I think the easiest backup would be to use rsync and backup the required areas but we use R1soft.

Depending upon the quantity and space used, using IW backup routine could cause a higher loading. R1soft does not cause high load as rsync does not.

Have you considered your databases, both siteworx and IW. You would need to backup these as well

This link may help I hope for rsync and I think IW-Jenna posted a while ago over backup.pex, so perhaps open a support ticket

Many thanks


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.

1 Like

Hi. Backup has not been working for the last week. Error technical failure. I can’t figure out how to fix the problem.

(Link deleted)


Would you be able to provide a bit more information as to the error you are seeing? Copy/pasting it would be helpful. :slight_smile:

Also, how are you managing the backup? Is it scheduled through SiteWorx? Was it created as a cron at the command line?

You may also want to check ~iworx/var/log/iworx.log for any errors during the time the backup is running.

Friendly Neighborhood InterWorx Support Manager

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.

1 Like

Glad you were able to resolve the issue. :smiley:

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.

Thank you,