ukweb Posted March 5, 2010 Share Posted March 5, 2010 hi there. I use SSH to backup my sites which are hosted with Media Temple. i used to have a guide to follow but I misplaced it. Basically I have a 'domains' directory, and a 'backup' directory. What we used to do is create a tar file in 'backup' containing the entire 'domains' directory. A quick google around has failed to give a solution that worked, and I dnt want to do any harm to my domains file Does anyone know the terminal command to do what I am after? thanks Ste. Quote Link to comment https://forums.phpfreaks.com/topic/194253-server-backups-with-ssh/ Share on other sites More sharing options...
trq Posted March 5, 2010 Share Posted March 5, 2010 Your entire post is a little vague really. SSH is a network protocol, you can't backup anything with it. Of course, you could backup data into an archive and then use the SSH protocol to move it to another server. Anyway, I'll stop being a pain in the ass. In simple terms you could simply archive whatever it is and then use scp (which copies files via the ssh protocol) to move that archive to another server. DIR=/var/www LOCATION=backup.server.com:/backups/directory TIMESTAMP=`date +%Y-%m-%d-%H%M` tar -czvf $TIMESTAMP.gz $DIR scp $TIMESTAMP.gz $LOCATION rm $TIMESTAMP.gz My advice however, would be to take a look at an existing solution. rsnapshot is an awesome utility that will create incremental backups for you. Its pretty easy to configure and has heaps of features. Quote Link to comment https://forums.phpfreaks.com/topic/194253-server-backups-with-ssh/#findComment-1022154 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.