NOW=$(date +”%b-%d-%y-%H-%M”)
#back everything up
tar -czvf /home/user/archives/$NOW.tgz /home/user/htdocs
mysqldump –user=user –password=XXXXX –opt some_database > /home/user/archives/some_database.$NOW.sql
#get the new content
scp -r user@example.com:/home/vhosts/user/htdocs/* /home/remotefiles/htdocs
mysqldump -h remotedata.com –user=user –password=XXXXX somedatabase | mysql -h localhost –user=user –password=XXXXX some_database
Shell scripting to archive local content and get remote content
Feb, 8 -- Categories: Linux