How to make rsync run automatically when a new file or directory is added?
Solution 1
I used the "script-torrent-done" options in transmission's settings.json and pointed that to a script which syncs the home-server Downloaded torrents' file with my laptop.
Solution 2
What you're looking for is inotifywait
, from the inotify-tools
package, which uses the inotify
mechanism.
reference:
http://blog.lagentz.com/general/automate-your-shell-scripts-using-inotify-and-inotifywait/
http://linux.die.net/man/1/inotifywait
Related videos on Youtube
Danial Behzadi
Ubuntu Official member Ubuntu Iranian LoCo team member https://launchpad.net/~dani.behzi
Updated on September 18, 2022Comments
-
Danial Behzadi over 1 year
I decided to use rsync for backing up my downloaded torrents from my home-server to my laptop. I read the whole manual, but I didn't find a way to sync files automatically when a new file or directory is added to the complete torrents directory.
The Best thing I could find was running rsync daily by a cron-job, But I want it to be more intelligent, like Ubuntu-One and do the job just when a new thing adds.
-
quanta almost 11 years
-
quanta almost 11 years
-
Admin about 10 yearsCheck this out, it's a daemon that does what you want: code.google.com/p/lsyncd
-