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:48] – [full local backup to tmp] 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> |
| |
| |
| |
* local run save to ssh | * 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' | 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> |