How to select a destination folder on another machine

Re: How to select a destination folder on another machine

by Scott Bartley -
Number of replies: 0

If anyone wants this info, I figured this out with help from my IT guy.

The folder saved in Moodle has to be on a drive local to that machine. We made a .bat file that copies the local folder onto another machine. Finally we made a Windows Scheduled Task that runs the .bat file a few minutes after the scheduled time that Moodle creates the backup.

The syntax of the file had to be tweaked a few times to get it to work. I'm not an expert on scripts, so there may be a more efficient example, but this one works. Replace "server1" and "anothermachine" with the name of your moodle server and the second machine to which you wish to copy the backup files. The path saved in Moodle in Administration->Courses->Backups is D:\Support\backup\moodle which corresponds to "\\server1\d$\Support\backup\moodle\" in the script in my example, and "\\anothermachine\common\Systems\Backup" is the folder location on the other machine. Everything from the "xcopy" to the "/y" is on one line in case the forum creates an artificial line break. Add the word "pause" before the exit line if you need to see it in action for testing/troubleshooting purposes. Copy and paste this text below into Notepad and then change the file extension from .txt to .bat. After you've gotten it to work, use the task scheduler to fire it 10 minutes or so after your scheduled time in Moodle.

xcopy "\\server1\d$\Support\backup\moodle\*.*" "\\anothermachine\common\Systems\Backup" /y

exit