Schedule Automatic Daily Backups of Changed Files to Cloud Storage

I’ve already talked about my backup routine in an earlier post. Part of that involves daily backups to CX (Cloud Exchange) –  it’s my first choice cloud storage site as it gives 10GB free storage. Like Dropbox and SkyDrive etc, just drag your files to the CX desktop folder and they are automatically synced to the cloud.

That’s great, but what about scheduling automatic daily backups of your changed documents to the cloud? For me, it’s important to have a second copy of my recently changed work files in the cloud, just in case my PC doesn’t boot next morning, for example. We need a way to automatically select documents you’ve worked on that day, and at a preset time, copy those files to your CX folder for syncing to the cloud. I’m going to show you how I do this.

Get some free cloud storage

If you haven’t already done so, sign up for free cloud storage and make a note where your desktop folder is for syncing to the cloud. For me, it’s C:\Users\<user name> \Desktop\CX Sync.

Create a batch file to copy daily changed files to the CX folder

Yes, I know batch files are a little old school but, once set up correctly, they get the job done. We’ll make one to execute a simple command to copy today’s changed files to our syncing folder, but first why select just changed files? Well, if you have a good backup routine in place, all your documents older than today should be on your external drive anyway. During the current day, you’ve been editing documents, photos or videos and these current files should be backed up to your external drive and the cloud at the end of the day. You could use a backup program but why download another utility when you already have the tools to do it for free in Windows.

We can create a batch file with a text editor like Notepad++. In the batch file, the command Robocopy is used to copy your daily files from the source folders to a destination folder, your syncing folder. Robocopy is available in Windows Vista and Windows 7.  The format for the Robocopy command here is Robocopy <source folder> <destination folder> switches. The switch /MAXAGE:1 makes the command select just today’s files (i.e. it excludes files older than 1 day). The switch /S tells Robocopy to copy subfolders. Open your text editor and copy and paste the following lines to make your batch file:

echo off

echo Daily files to CX

Robocopy “c:\Users\<user name>\Documents” “C:\Users\<user name>\Desktop\CX Sync” /MAXAGE:1 /S

echo Backup complete
pause

You’ll have to edit <user name> to your own user name and you’ll have to change some details to point to your correct source and destination folders. The destination folder should be your syncing folder, in my case CX Sync. If the source or destination paths contain spaces in them, enclose these in double quotes as shown above. Now save it as a batch file (.bat) on your desktop, NOT as a text file (.txt). Give it a sensible name, something like Daily docs to CX.bat. Here’s how the Save as screen looks in Notepad++:

Save as batch file

Try it out by double clicking this batch file on your Desktop  to see if it’s copying today’s changed files to your syncing folder.

Schedule your daily backup with Windows Task Scheduler

So far so good I hope. But so far we’re relying on remembering to click this batch file each day. Much better if we could automate this process to run the batch file at a specific time each day, say 9pm when all work for the day is finished and we are doing other things on our PC. Well, we can set up Windows Task Scheduler to do this.

Click the Windows Start button and key in Task in the search window. This should bring up Task Scheduler on the list. Click it, then right click Task Scheduler Library and choose Create Task. Under the General tab, fill out the task Name:

Task Scheduler1

Then click on the Triggers tab and click New. Fill out the time for your scheduled backup to run and make sure Daily is selected. Click OK.

Task Scheduler2

Then click on the Actions tab and click New. Fill out the location of your batch file by browsing to your desktop and selecting the file. Click OK.

Task Scheduler3

Select the Conditions tab and set it up as shown.

Task Scheduler4

I found it best to uncheck the default ‘Start the task only if the computer is idle for:’ I want it to run right away at 9pm with no delay. Click OK to complete setting up your scheduled backup task and close the Task Scheduler.

When this scheduled task runs at your chosen time, it runs in the background anyway. The pause command at the end of the batch file means the window will remain open so you can check it has run correctly.  When you’re satisfied everything is okay, press any key to close the batch file window.

So there we have a free route to set up a scheduled backup of your daily edited files to the cloud without downloading any utilities. Eventually, when your free online storage starts to fill up, you can delete some of the older files to free up space. They should all be on your external drive anyway. How do you schedule backups? Have you any suggestions to improve this routine. I’d love to hear your thoughts.

Update (28 July 2012): If you want to take this a little further, and you’re interested in client-side encryption before backing up, I’ve recently added a new post on Scheduling Encrypted Daily Backups of Changed Files to Cloud Storage.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment. Please do not use keywords in the Name field. Comments must relate to the post topic. This website is here to help people, not for advertising purposes.

Please complete puzzle and then submit your comment *
Time limit is exhausted. Please reload CAPTCHA.

` `