I want move (not copy with scp) my file from the server to the local repository and finally delete it on the server after transfer. I use next command from the repository, where I want have the file:

rsync -rvt --delete-after user@host:/path . 

I really copy the files by this way. Anyway, the files on the server are not deleted.... It is necessary to do: rm -r filename

Can somebody improve my linux statement and show me, how I can transfer and remove file from the original place in one move.


According to the answer of @user1008764 I want add here additional useful link to the another discussion (how to delete not only the file, but also the directory): https://superuser.com/questions/676671/rsync-does-not-delete-source-directories


1 Answer 1


try --remove-source-files instead of --delete-after. have a look at serverfault.com/questions/363922/how-to-move-files-with-scp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .