Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1232  / 1 Year ago, tue, december 6, 2022, 2:59:11

I'd like to have a copy of my .emacs file in my Dropbox folder but I'd also like to have this copy in an automatic way, I mean every time I change my .emacs in the home directory I want it to be instantly updated in the Dropbox directory (this necessity is because I want the .emacs to be equal in my windows and ubuntu partitions and I think Dropbox is a good tool for that). First I used the simple:



$ cp .emacs Dropbox/.emacs


then I tried using rsync (or gsync), well it works but I cannot grasp the difference between rsync and cp for this very simple backup. In fact, even if I have activated the option RSYNC_ENABLE=true in the rsync file, every time I modify the .emacs in my home I have to run the command rsync (or use gsync), as a cp, without having it automatically. How can I have it automatically?



Probably I'm missing something from the very basics of rsync.



Thanks for your help


More From » automation

 Answers
7

You're misunderstanding what rsync does. Unlike what the name suggests, it doesn't really sync anything on its own. It works almost the same as cp, except that it when it encounters the same file on the destination, it only updates it if it has changed. That is helpful when you're copying over a network, because it can save bandwidth. It does not, however, monitor files.



A better solution in your case is to move your .emacs directory to ~/Dropbox/.emacs, and have ~/.emacs be a symbolic link to it:



$ mv .emacs ~/Dropbox
$ ln -s ~/Dropbox/.emacs .emacs


Then you don't need any local syncing.


[#34447] Tuesday, December 6, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hical

Total Points: 498
Total Questions: 106
Total Answers: 117

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
hical questions
Sun, May 9, 21, 00:59, 3 Years ago
Fri, Jun 25, 21, 03:06, 3 Years ago
Thu, May 19, 22, 15:32, 2 Years ago
;