Scripting: Backing up to ftp server and scheduling

Hello all,

I created a script using Dopus that I run every night, which copies a bunch of important files to a backup folder on an external USB drive, then uses Winrar to compress these into one file (for a nightly backup), like so:

winrar a -r -df J:\Backup{date|yyyy'.'MM'.'dd}.rar J:\Backup{date|yyyy'.'MM'.'dd}

After that, I copy the backup file to a remote ftp server that belongs to me:

Copy J:\Backup{date|yyyy'.'MM'.'dd}.rar TO=@Backup WHENEXISTS=REPLACE

However, since I only need the very latest backup file on the ftp server every night, I'd like to change the name of the nightly file when I copy it over, so it would just overwrite the previous file. I tried the following, which doesn't work:

Copy J:\Backup{date|yyyy'.'MM'.'dd}.rar TO=@Backup\nightly_backup.rar WHENEXISTS=REPLACE

Anybody know how I can pull this off?

Also, I have this little script as a menu item, but I currently have to run it manually. Is there any way for me to run this from the command-line so that I can schedule it to run in the middle of the night while I sleep?

Not sure if there's any rub with the destination being FTP (shouldn't be AFAIK)... but you should be able to use something like this:

Copy J:\Backup{date|yyyy'.'MM'.'dd}.rar TO=@Backup AS=nightly_backup.rar WHENEXISTS=REPLACE

Ok, that's working great. Now, any way for me to run this from a scheduler program ? :slight_smile:

I certainly haven't tried this, but I think you can run something like

"C:\Program Files\Directory Opus\dopusrt.exe" /CMD Copy ...

where "Copy ..." represents the entire command that already works.

The key point is that "dopusrt /cmd" can be used to execute DOpus commands from outside DOpus, so you should be able to schedule it, I guess.

(You well may have to adjust the path to dopusrt.exe).