- scp -pr
-
scp -pr /home/simonh me@backup.net:/home/me/backups
- recursive copy (r), maintaining permissions (p),
of a directory;
- fine for smallish backups.
- tar over ssh
-
- copying each file incurs an overhead — significant if lots
of small files;
- in this case, use tar and copy only one file. . .
tar cvzf - /home/simonh | ssh me@backup.net "cat > simonh.tar.gz"
- rsync
-
- With regular/frequent backups, better to copy only changes —
new/changed files:
rsync -av -e ssh /home/simonh me@backup.net:_backups
#
# ...not "/home/simonh/" which backs up each file and directory
# within /home/simonh...