Join for free
Bruce's Avatar
Bruce
Chatterbox
Bruce is offline
Wollongong, Australia
Joined: Apr 2012
Posts: 15,218
Bruce is male  Bruce has posted at least 25 times and has been a member for 3 months or more 
 
02-02-2017, 12:08 PM
1

Using OneDrive as a Windows Backup

This is a looong message...

Some of you probably already use some of the 'cloud' services like Dropbox and Google Drive; they all offer slightly different services and all have advantages and disadvantages. One I recently started to use is Micro$oft's OneDrive. I needed it because my free allowance of Dropbox is just about gone. It used to be called SkyDrive (I think that is right) but changed to OneDrive so if you have Skydrive on your computer then this is the same thing.

You probably know that the 'Cloud' is just a remote storage for some of your important files so that you can access them from other computers no matter where you are in the world or it is a safe backup of important files that would be lost if your computer or phone crashed or was stolen. There are lots of companies offering this service with a basic allowance free of charge, OneDrive is just one of many.

I have used Dropbox for years as a lazy way of getting photos taken on my phone to my desktop computer. It works great - if I am out and take some photos by the time I return home the photos are available (synced) on my Desktop Computer as well as being stored safely in "The Cloud".

With Windows both OneDrive and Dropbox create a directory on your hard disk from which they automatically upload files, personally I find that really annoying because I have spent some years getting my computer set up just how I like it and don't really want to move folders about just so that they can be backed up or uploaded to OneDrive for safety.

It is not always a problem; for example I still use a very old version of M$ Money and it is simple enough to make it save the back up file somewhere in the OneDrive folder. However what if you want a directory backed up to Onedrive which is somewhere within the Windows library system? after some pretty intense Googling I have found a solution in the form of a built in DOS command "mklink" which enables you to link a OneDrive directory to another directory elsewhere on the HDD. This is how you use it.

I have done some experiments with this MKlink command and it worked very well. I filled my OneDrive 15Gb allowance very quickly because I wanted to check that it didn't duplicate the linked directory on my HDD by using a big folder so I could check on disk space before and after.

OK, this is what I did.

OneDrive creates a directory called (believe it or not) "OneDrive" in the User space. On my machine for me that is:

C:\Users\bcl19\OneDrive\

in that directory several sub folders were also automatically created (similar to your Windows Library system) -
Documents
Favorites
Pictures
Public
Videos

The "C:\Users\bcl19" is specific to my drive but can also be expressed by the %userprofile% environmental variable which would make it exactly the same as on your drive. ie %userprofile%\OneDrive would find the OneDrive Folder on any machine that the login user had installed it.

This is the line I used to create the link:

mklink /J "%USERPROFILE%\OneDrive\MP3" "%userprofile%\Music\MP3 Player"

Here is an explanation of its components:

"%USERPROFILE%\OneDrive\MP3" this created the linked folder called MP3 in the OneDrive folder.

"%userprofile%\Music\MP3 Player" this was the existing directory that I wanted to backup on OneDrive and to which the newly created folder is linked (don't forget M$DOS/Windows is blind to upper/lower case so it doesn't matter that the variable is a different case to the other one). Windows will have, by default, created a directory called "Music" in your user space when you first made your account on your computer.

As I say it created a directory in OneDrive called MP3 when you looked at this in Windows Explorer the folder symbol had a little arrow just like a shortcut link but when you opened the folder it looked exactly the same as the "MP3 Player" directory in the Music library.

One thing I discovered is that if you create the folder MP3 manually or via a batch file command then the MKLINK command fails, it has to create the folder by itself.

I gave it a while for OneDrive to do its stuff then logged into my Hotmail account to check if the files had been uploaded and sure enough they had, completely filling the 15Gb allowance (I have a lot of music).

Now came the bit I was most nervous of: On my computer I deleted the linked folder MP3 in the OneDrive folder. Because it looked exactly like the MP3 Player folder I was slightly scared that that might disappear as well (it is backed up) but no, all was well, and the music folder remained in the Music Library but OneDrive immediately started to delete the files from storage in my Hotmail account.

My check of the before and after HDD used space showed a very slight difference (as you would expect) but certainly it was not a duplicate of the 15Gb+ space that the music took up.

All in all it was a very successful experiment.

BTW I have no idea why the command MKLINK uses the /J parameter; if I had just read the data for it I would have said it should have been the /D but searching several articles they all agreed on /J so that is the one I tried and it worked.

To sum up.

The basic command is:

mklink /J "%USERPROFILE%\OneDrive\<Your Folder Choice>" "%userprofile%\<Folder You Want Backed Up>"

Obviously the bits between '<' & '>' you have to decide for yourself.

The command line: mklink /J "%USERPROFILE%\OneDrive\MP3" "%userprofile%\Music\MP3 Player" could be typed in inside the CMD.exe window or you can use a text editor to create it perfectly and repeatablely (not sure if that is a word) then call the file "something.BAT". Several commands could be done one after the other. For example:

md "%USERPROFILE%\OneDrive\LibraryBU"
mklink /J "%USERPROFILE%\OneDrive\LibraryBU\MP3" "%userprofile%\Music\MP3 Player"
mklink /J "%USERPROFILE%\OneDrive\LibraryBU\Holiday Snaps" "%userprofile%\Pictures\2017 Holiday"
mklink /J "%USERPROFILE%\OneDrive\LibraryBU\Videos" "%userprofile%\Videos\2017 Videos"
mklink /J "%USERPROFILE%\OneDrive\LibraryBU\Templates" "%appdata%\Microsoft\Templates"

Once you have created the file and saved it just double click on it for it to operate (only needs to be done once).

I hope that makes some sense: The first line creates a folder (not linked) in the OneDrive folder (md = Make Directory) and the following four lines create linked folders within it. The final line merely backs up your M$ Office Templates using a different variable (haven't tried it in this context but it should work).

Be brave have a go.
Omah's Avatar
Omah
Chatterbox
Omah is offline
Ludlow
Joined: Feb 2014
Posts: 10,147
Omah is male  Omah has posted at least 25 times and has been a member for 3 months or more 
 
02-02-2017, 01:40 PM
2

Re: Using OneDrive as a Windows Backup

SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders.

https://www.microsoft.com/en-gb/down....aspx?id=15155

Overview
There are files from all kinds of sources that we want to store and manage. Files are created by our digital cameras, e-mail, cell phones, portable media players, camcorders, PDAs, and laptops. Increasingly, computer users are using different folders, drives, and even different computers (such as a laptop and a desktop) to store, manage, retrieve and view files. Yet managing hundreds or thousands of files is still largely a manual operation. In some cases it is necessary to regularly get copies of files from another location to add to primary location; in other cases there is a need to keep two storage locations exactly in sync. Some users manage files manually, dragging and dropping from one place to another and keeping track of whether the locations are synchronized in their heads. Other users may use two or more applications to provide this functionality.

Now there is an easier way. SyncToy, a free PowerToy for Microsoft Windows, is an easy to use, highly customizable program that helps users to do the heavy lifting involved with the copying, moving, and synchronization of different directories. Most common operations can be performed with just a few clicks of the mouse, and additional customization is available without additional complexity. SyncToy can manage multiple sets of folders at the same time; it can combine files from two folders in one case, and mimic renames and deletes in another case. Unlike other applications, SyncToy actually keeps track of renames to files and will make sure those changes get carried over to the synchronized folder.


SyncToy can be run stand-alone or as a scheduled process ....
Bruce's Avatar
Bruce
Chatterbox
Bruce is offline
Wollongong, Australia
Joined: Apr 2012
Posts: 15,218
Bruce is male  Bruce has posted at least 25 times and has been a member for 3 months or more 
 
02-02-2017, 11:37 PM
3

Re: Using OneDrive as a Windows Backup

Originally Posted by Omah ->
SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders.
Yes, I came across SyncToy when I was researching this, but even though this looks complicated it is a one off set and forget with no need for other programs.

A problem with OneDrive is that it has a tendency to produce duplicates if you are using it to sync across machines.

Do you use SyncToy?
Omah's Avatar
Omah
Chatterbox
Omah is offline
Ludlow
Joined: Feb 2014
Posts: 10,147
Omah is male  Omah has posted at least 25 times and has been a member for 3 months or more 
 
03-02-2017, 01:39 AM
4

Re: Using OneDrive as a Windows Backup

Originally Posted by Bruce ->
Yes, I came across SyncToy when I was researching this, but even though this looks complicated it is a one off set and forget with no need for other programs.

A problem with OneDrive is that it has a tendency to produce duplicates if you are using it to sync across machines.

Do you use SyncToy?
I use Synctoy to backup updated MP3s from my 25,000 collection - SyncToy runs a comparative check on each MP3 folder on two networked PC's then copies as necessary from the primary to the secondary - 3 clicks if I run manually, none if scheduled as a daily batch process.

I only run it one-way (Echo) but other options are available.

I have never had a problem with One-Drive and duplicates on networked PCs.
Bruce's Avatar
Bruce
Chatterbox
Bruce is offline
Wollongong, Australia
Joined: Apr 2012
Posts: 15,218
Bruce is male  Bruce has posted at least 25 times and has been a member for 3 months or more 
 
05-02-2017, 12:59 AM
5

Re: Using OneDrive as a Windows Backup

Originally Posted by Omah ->
I use Synctoy to backup updated MP3s from my 25,000 collection - SyncToy runs a comparative check on each MP3 folder on two networked PC's then copies as necessary from the primary to the secondary - 3 clicks if I run manually, none if scheduled as a daily batch process.

I only run it one-way (Echo) but other options are available.

I have never had a problem with One-Drive and duplicates on networked PCs.
Interesting. Personally to update my music server I just use a batch file called by Windows built in Task Scheduler but I guess Synctoy would do the job too.
Omah's Avatar
Omah
Chatterbox
Omah is offline
Ludlow
Joined: Feb 2014
Posts: 10,147
Omah is male  Omah has posted at least 25 times and has been a member for 3 months or more 
 
05-02-2017, 05:15 AM
6

Re: Using OneDrive as a Windows Backup

Originally Posted by Bruce ->
Interesting. Personally to update my music server I just use a batch file called by Windows built in Task Scheduler but I guess Synctoy would do the job too.
I like to keep it simple .....

I spent years programming mainframe computers - now I let others do the coding while I just point and click .....
 



© Copyright 2009, Over50sForum   Contact Us | Over 50s Forum! | Archive | Privacy Statement | Terms of Use | Top

Powered by vBulletin Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.