Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So right now I use rsync to synchronize files with a server. Sometimes the files on the server are deleted (I know about the --delete option and I do not use it) and those files are left in my local directory for me to clean up later.

Unfortunately this requires me to pull up the list of files on the server, figure out which files are no longer on the server, and move them to a different local directory.

I want to somehow automate this process. I do not know if such an option exists in rsync, but I would settle for anything as long as it would get automate this repetitive task.

Does anyone know how this could be accomplished?

share|improve this question
I think you would have to write a custom script to move deleted files to the trash. – Warren P Apr 7 '13 at 20:34
I actually don't wanna move my files to the trash, although I figure that's a minor change. In any case I figured out a solution which I'm about to post. – RedHack Apr 8 '13 at 16:21

I figured it out on my own. The solution is to mount the SFTP directory from the server to a local directory using sshfs and then use diff. For those who wish to use this workaround you can find directions here: and here: Just remember to use the -o allow_other option with sshfs otherwise you're going to have file permission problems.

share|improve this answer
I'd grown used to this for local backups with Carbon Copy Cloner on Mac OS X, which previously used an rsync variant called psync, but they went commercial, abandoned it, and lost that functionality. lol – Jeff Burdges Apr 25 '15 at 3:53
Isn't the "right way" to do this with --link-dest? I've never used it myself, and you must seemingly write a script to make up a new directory each time, but it'll do the trick. Appears less user-friendly than time machine :… – Jeff Burdges Apr 25 '15 at 3:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.