This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision |
| linux:backup [2024/06/03 13:01] – [Linux. backup] admin | linux:backup [2024/06/03 13:48] (current) – [full local backup to tmp] admin |
|---|
| |
| * only if root available for login SSH | * only if root available for login SSH |
| | <code BASH> |
| ssh root@bot.ip2u.ru 'cd / && tar -cvf - --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/media --exclude=/var/log --exclude=/var/lib/lxcfs/ --exclude=/var/cache/apt/archives / | gzip -9 ' | pv | cat > /mnt/d/backup/bot-ar/bot-ar-`date +%m-%d-%Y`.tgz | ssh root@bot.ip2u.ru 'cd / && tar -cvf - --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/media --exclude=/var/log --exclude=/var/lib/lxcfs/ --exclude=/var/cache/apt/archives / | gzip -9 ' | pv | cat > /mnt/d/backup/bot-ar/bot-ar-`date +%m-%d-%Y`.tgz |
| | </code> |
| |
| |
| * brotli - very slow | * brotli - very slow |
| tar -cf - --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/media --exclude=/var/log --exclude=/var/cache/apt/archives / | brotli | pv | cat > /tmp/bot-ar-`date +%m-%d-%Y`.tar.bt | tar -cf - --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/media --exclude=/var/log --exclude=/var/cache/apt/archives / | brotli | pv | cat > /tmp/bot-ar-`date +%m-%d-%Y`.tar.bt |
| | |
| | |
| | * local run save to ssh |
| | <code BASH> |
| | tar -cvf - --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/media --exclude=/var/log --exclude=/var/lib/lxcfs/ --exclude=/var/cache/apt/archives / | gzip -9 | ssh user@remote_server.example.com 'cat > /path/to/backup/bot-ar-`date +%m-%d-%Y`.tgz' |
| | </code> |