You are not logged in.
Pages: 1
I want to sync two folders, ~/Work with ~/Dropbox/Work, meaning when I change something in the ~/Work I want ~/Dropbox/ to change and vice versa. I know there is rsync but it only backups files as I understand it.
Last edited by johnnyponny (2011-04-24 13:21:46)
Offline
Why not just create a symlink of ~/Dropbox/Work in ~?
If you want some safety you can always use cron to do regular backups.
Last edited by demian (2011-04-24 13:12:17)
no place like /home
github
Offline
I want the folders to be synced instantaneous if I can.
EDIT: Does this make two folders or just one?
Last edited by johnnyponny (2011-04-24 13:20:28)
Offline
I want to sync two folders, ~/Work with ~/Dropbox/Work, meaning when I change something in the ~/Work I want ~/Dropbox/ to change and vice versa. I know there is rsync but it only backups files as I understand it.
$ crontab -e
Have a cron job run this every minute:
*/1 * * * * rsync -avx --progress --delete-after ~/Work/ ~/Dropbox/Work/
Just know that the --delete-after switch will delete ANYTHING that isn't in ~/Work from ~/Dropbox/Work
...are you sure this is the behavior you want? Also, that won't satisfy the "vice versa" part of your needs.
Last edited by graysky (2011-04-24 13:29:44)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
If you symlink, you'd have one folder. Why have two if you want them to have exactly the same content anyway?
If you want one as backup it'd make sense but then you'd better put one of the folders on another data medium.
no place like /home
github
Offline
Yeah I want one as backup on my computer, the other one is on the cloud I think.
here is what I did
ln -s ~/Work ~/Dropbox
ln -s ~/Dropbox ~/Work
Last edited by johnnyponny (2011-04-24 13:33:59)
Offline
That's a loop you've created there, i.e. it won't work.
Here's what you do:
You remove ~/Work
You create a symbolic link of ~/Dropbox/Work in $HOME (~)
Now, you can access your Work directory in both ~/Work and ~/Dropbox/Work but all changes will take place in ~/Dropbox/Work which is best because dropboxd can instantly upload those changes. Also, you don't have to keep two directories in sync.
Since you still want a backup of your work, you take grayskys suggestion and create a cron tab
*/1 * * * * rsync -avx --progress --delete-after ~/Dropbox/Work/ /wherever/you/want/your/backup/
no place like /home
github
Offline
Ok, thanks a lot!
Offline
Pages: 1