.tar.gz /var/www and vardump mysql and ssh to remote srv

Simple how to tutorials for linux.
Post Reply
User avatar
sonik
Site Admin
Posts: 36
Joined: 12 Nov 2018, 22:12

.tar.gz /var/www and vardump mysql and ssh to remote srv

Post by sonik » 19 Aug 2019, 12:29

First things first. With this small and simple tar command we archive all our /var/www/ data.

Code: Select all

tar -zcvf archive.tar.gz /var/www
Now we dump the MySQL database with the next command.

Code: Select all

mysqldump -u root -p databasename > /root/backupname.sql
You will be asked to write the password for the database user (in this case root).

Code: Select all

scp archive.tar.gz root@destinationserver:/root
scp /root/backupname.sql root@destinationserver:/root
Again you will be asked twice for the password of the remote server but all your sensitive data will be saved there.
Again this is a very simple and just a small demonstration of what you can do with linux and ssh.

Post Reply