Robocopy Script

James Bond

Diamond Member
Jan 21, 2005
6,023
0
0
Hi All,

This isn't true programming per se, but I figured I would post here anyway :)

I'm trying to create a Robocopy job that kicks off on a nightly basis, which copies a directory from one server to another. Nothing fancy - just a basic overwrite each night.

What's the easiest way to accomplish this? I would like to just use scheduled tasks, but how do I actually "write" this?

Links would be fine, any help appreciated!
 

Onund

Senior member
Jul 19, 2007
287
0
0
If your server is a Windows machine, on XP it's like this:
Control Panel->Schedule Tasks->Add Scheduled Task

It should be fairly straight forward how to set it up from the gui, follow the steps then I think in the advanced mode you can put command line options. If not, create a batch file with your command and parameters then set the task to launch that batch file.

If your server is a Linux machine you can setup a cron job with 'crontab -e' (probably want it to run as root? so sudo if necessary) or put a script in the /etc/cron.daily folder.

Googling 'cron job' should give you enough info on how to set it up. Very easy to do.