Automatically sync your custom folders to Google Drive or One Drive

A

As a common user utilizing the cloud services offered by various vendors such as Google, Dropbox, Microsoft, Box and others. I faced many challenges in terms of managing the content backup across devices and one of them is to back up a folder that is not part of the cloud folder. For example, One Drive has an option to automatically sync the folders that are part of your My Documents but not the folder you stored elsewhere and same applies for Google drive where the content back up only happens for those folder in Drive main folder. As time passes, you will realize that you don’t have enough storage space left in the drive where cloud storage happens (or) you have realized that you need to sync the folder that is not part of the cloud storage folder.

Either way, in this post we are going to address this problem through a Windows only technique called Junction, a variant of symbolic link. In case if you are wondering what a Symbolic Link is (a.k.a symlink), it is a shortcut that point to the original data that is stored in filesystem. There are different types of symlinks and Junction is a combination of soft and hard link. Let’s not get into details of these types for the sake of simplicity but just know that Junction is a shortcut that points to original file/directory.

Sync Folders to OneDrive (or) Dropbox (or) Google Drive

All the cloud service providers have their own software program that creates a sync folder on your PC. In most probabilities considering you have not changed the sync folder location they are available under your user folder in C drive. Look at the screenshots for each of these cloud services and their sync folder location.

1) Dropbox – Download and install Dropbox for Windows

Dropbox

2) Google Drive – Download and install Backup and SyncGoogle Drive

3) OneDrive – Download and install OneDrive OneDrive

Assuming that you know the location of the folder from which your cloud service syncs your files, next step is to sync the custom folder you want to be automatically synced.

As an illustration, let us sync one of our custom folders to Google Drive. Back up and Sync is linked to the folder “C:\Users\pavan\Google Drive”, so I would have to create a Junction in this folder pointing to the new custom folder that I wanted to be automatically synced.

The way we can create a Symbolic Link in windows is using command line command “MKLNK”. We have to use it with “/J” option to create a Junction link. For example

mklink /J "C:\Users\pavan\Google Drive\Documents" "E:\Pavans\Documents"

The first parameter for above command is the directory location where the Junction has to be created and the second location is the location where the Junction should point to.

With the above command we will now be able to sync all the files in Document folder of E drive to Google Drive without consuming the storage in C drive. You can try the same for different sync folder and should be able to get the same result.

Note: Please remember that your filesystem will not wipe off the memory allocated to the Junction folder as long as all the Junctions pointing to the directory are removed.

Hope you enjoyed the article and for any queries please comment below.

About the author

pavankumar.p1990

Add comment