Server Fault is a question and answer site for system and network administrators. 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

I'm trying to back up a file via the command

scp /tmp/backup.tar.gz hostname:/home/user/backup.tar.gz

When I run it, the scp progress bar shows up and it looks like its transferring the file, however when I log into the destination server to check the file, the timestamp and filesize haven't changed from the older version, so it looks like scp didn't overwrite the old file at all. It only sees to work when I manually delete the file from the destination server.

I'm running ubuntu, and this is happening on two servers: one cygwin ssh, and one fedora core 3.

Anyone have any idea why this is happening? I thought scp would ONLY overwrite existing files..


share|improve this question

migrated from Jun 14 '10 at 6:09

This question came from our site for professional and enthusiast programmers.

Also happens to me on CentOS 6.0. I'm copying files from Slackware 12.1. Client ssh version is 5.0p1 and server ssh version is 5.3p1. – Milan Babuškov Apr 9 '12 at 16:03

If I omit the destination file name and only specify directory, then it works:

scp /tmp/backup.tar.gz hostname:/home/user/

I don't understand why, but it might be solution to your problem as well.

share|improve this answer

Under debian/lenny this is working. Perhaps you use scp -v $localFile $RemoteHost:$RemotePath/$localFile

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.