Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Saturday, 20 August 2016

Date of last backup

From my previous posts, you're running BgInfo, and you're doing regular on-demand backups to OneDrive.

So let's add a line to BgInfo, showing you when you last did a backup to OneDrive.


  1. Add a line to your backup script to write the date out to a text file. You could actually write anything to the file, because it's the file date we shall be using in BgInfo, but the date is as good as anything.

    @echo %DATE% > c:\folder\PhysicalLastDate.txt
  2. Create a new User Defined Field in BgInfo; use the Timestamp of a file, and point that at the file you've just written in step 1.
  3. Add the new field to BgInfo and save your settings.
And that's it!

Tuesday, 22 March 2016

Backup to OneDrive

OneDrive, out of the box, is very focussed on making your files available across all your devices; but what if you just want to use it as a cloud backup?

A little bit of scripting will come to your rescue. I'm sure the same could be done with PowerShell, but I'm an old die-hard .bat user when the opportunity arises!

Create a new batch file, and set up robocopy to copy all the files you want to back up to the OneDrive directory located under your user directory (e.g. C:\Users\Fred\OneDrive). Even if you want to back up your entire data volume you will want to exclude directories like System Volume Information and the Recycle Bin because they can cause sharing violations; so use the robocopy /xd syntax. I also found that the /fft switch prevented files being missed due to slight timestamp differences.

Once you're done, save that file out with a .bat extension, and you're good to go.

I've created a menu shortcut and run the backup manually a few times a week. The file copies everything to the local OneDrive directory and then it's down to how quick your upload speed is.

Now you just need to configure OneDrive itself. Open the Settings dialogue. On the Settings tab, make sure 'Start OneDrive automatically when I sign into Windows' is ticked and 'let me use OneDrive to fetch any of my files on this PC' is unticked.' One the Account tab click Choose Foilders, and make sure that the selected directories are as near as possible to the structure you're actually going to back up (although as the batch file will be doing the pushing it's not too essential).

Click OK to exit the OneDrive settings, and you're good to go with your online cloud backup of up to 15Gb. (You did claim your full 15Gb didn't you).