Redirect Users Documents and Pictures folders to Google Drive folder

abc_mhorn
New Contributor II

Does anyone know how to do folder redirection of a users Documents and Pictures folders to a folder in Google Drive if it is installed? I'm thinking of creating a symlink via script but I wanted to know if anyone has a method that has worked for them.

2 ACCEPTED SOLUTIONS

calumhunter
Valued Contributor

symlink via script would be the way to go. pretty straight forward move the folders into the google drive folder and them symlink them back into the home folder

View solution in original post

abc_mhorn
New Contributor II

Thanks for the guidance on this. Rather than creating a script that would run based on a Policy, we decided to do this manually in our deployment process. For anyone else interested, this is what we ended up using for our deployments.

# Move local user's Documents folder into Google Drive
sudo mv $HOME/Documents $HOME/Google Drive/Documents

#Symlink the Google Drive Documents back to the local folder
ln -s $HOME/Google Drive/Documents $HOME/Documents

# Move local user's Pictures folder into Google Drive
sudo mv $HOME/Pictures $HOME/Google Drive/Pictures

#Symlink the Google Drive Pictures back to the local folder
ln -s $HOME/Google Drive/Pictures $HOME/Pictures

View solution in original post

4 REPLIES 4

calumhunter
Valued Contributor

symlink via script would be the way to go. pretty straight forward move the folders into the google drive folder and them symlink them back into the home folder

abc_mhorn
New Contributor II

Thank you for the response calumhunter. Sorry I didn't respond sooner. I plan on make a script to symlink the folders as suggested. Do you or anyone else have a sample script they have used for this task?

abc_mhorn
New Contributor II

Thanks for the guidance on this. Rather than creating a script that would run based on a Policy, we decided to do this manually in our deployment process. For anyone else interested, this is what we ended up using for our deployments.

# Move local user's Documents folder into Google Drive
sudo mv $HOME/Documents $HOME/Google Drive/Documents

#Symlink the Google Drive Documents back to the local folder
ln -s $HOME/Google Drive/Documents $HOME/Documents

# Move local user's Pictures folder into Google Drive
sudo mv $HOME/Pictures $HOME/Google Drive/Pictures

#Symlink the Google Drive Pictures back to the local folder
ln -s $HOME/Google Drive/Pictures $HOME/Pictures

sandygm
New Contributor

I am wondering how i can do this as part of the imaging process. Currently I use deploy studio to dump the image and install apps, then join AD. At this point, the user logs in and it creates the home folder on the drive. Then they open Google Drive and have to sign in and run the quick wizard. At that point the Google Drive folder is created in their home folder. I would like to be able to have their documents, desktop, photo, and music folder then be moved to the google drive with the links created then. Is it possibke to script this automagically after they sign into google drive and the folder is created? I hope that makes sense....