Make full backup of your server over ssh

If you want full backup your filesystem from your server use next command: (Will backup next folders from root: usr etc home root ssl var lib)

time ssh [email protected]168.1.20 "(cd / ; GZIP=-9 tar zcf - usr etc home root ssl var lib )" > back_$(date +"%d_%m_%Y").tar.gz

.sock files may be not included, but actually, it is runtime files, so we don't need them, also it noticed that some files may be changed during the backup

tar: ... .sock: socket ignored
tar: ... .log: file changed as we read it

Time of backup can be not really big:

real    43m3.882s
#ssh #backups
0
Ivan Borshchov profile picture
Mar 26, 2017
by Ivan Borshchov
Did it help you?
Yes !
No

Best related