I'm bored, lets start.
We are going to, take a backup of /var/www & Mysql, put it all in a tar.xz file, then pull it away from the server. Let's start.
What you need :
Take a backup, and tell the script to put it where ever you wan't...
For my script I cronjob it like this
You can also do --help for information on what that does & more does... this does it automatic at 06:30AM every day.
Ok, then you can run this on your local PC in cron :
This will copy the backup from your server to your PC and would run 06:35AM every day.
Also only take the files that are missing from your backup/storage on the PC...
You can add "--delete" after "-zavrR" to delete files after the copy.
To install a cronjob you run this line :
-e is to edit users crontab (Cronjob) file and enter your cronjob line.
Have fun. 😑
We are going to, take a backup of /var/www & Mysql, put it all in a tar.xz file, then pull it away from the server. Let's start.
What you need :
- Backup script What I use
- *nix server, *nix local-PC
- SSH keys installed on the server (Without passphrase for crobjob.. )
Take a backup, and tell the script to put it where ever you wan't...
For my script I cronjob it like this
PHP Code
<?php
30 6 * * * /PATH/TO/SCRIPT/backup.sh -v -f /var/www/ -t /PATH/TO/BACKUP/PLACE/ -p PREFIX -d DATABASE -u MYSQLUSER -a MYSQLPASS
You can also do --help for information on what that does & more does... this does it automatic at 06:30AM every day.
Ok, then you can run this on your local PC in cron :
PHP Code
<?php
35 6 * * * rsync -zavrR --links --rsh="ssh -l {SSH-USER}" {SERVER}:/PATH/TO/BACKUP/ON/SERVER /PATH/TO/BACKUP/STORAGE/ON/YOUR/PC
Also only take the files that are missing from your backup/storage on the PC...
You can add "--delete" after "-zavrR" to delete files after the copy.
To install a cronjob you run this line :
PHP Code
<?php
crontab -e
Have fun. 😑

