can I use the dd command to backup a file on a ftp server rather than network share?


Please note that dd is not very efficient as a backup tool, it copies the entire partition space including used an unused space. Using partimage (package available from the repositories) is a better option. Because partimage does not have integrated FTP support you would need to use something like curlftpfs. I am not sure it would be reliable. FTP was designed to upload files previously created, not to update them incrementally.

  • dd can also take files as the if= argument, which might be what Abdul Khaliq means. (That is not a good way to perform backups, though.) – Eliah Kagan Aug 16 '12 at 16:44

Other tools you might want to check out are tar and rsync. Creating backup tarballs is simple and there are lots of preconfigured lines out there.

Rsync might be your best bet. It does incremental backups and takes lots of options (again, look around for an rsync oneliner that does what you want). It doesn't result in one file though, but an exact copy of the folder structure and files.


Use this while logged into your ftp server via the ftp command:

put "|dd if=/dev/DISK0 bs=1m count=1000|bzip2" backup.bz2

of course, replacing DISK0 with your disk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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