Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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: http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/ and here: http://linuxcommando.blogspot.com/2008/05/compare-directories-using-diff-in-linux.html Just remember to use the -o allow_other option with sshfs otherwise you're going to have file permission problems.

share|improve this answer

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.