W
willgnosis
Guest
OK.. I wanted to write this because it has just taken me about 2 weeks of searching the net and trial and error to finally get a backup how i wanted.
In case you didn't know.. when you use the Plesk Backup Scheduer, it creates a file that apparently only Linux can unpack and is basically useless if you want to ever open the files on a pc.
So if, like me, you just want to be able to make a regular backup of your webisite files and it's databases you can do it like this:
First:
log into FTP using root user and go to the path /
Make a new folder called backup
make sure it has permissions set to 777
(most FTP programs you can right click the folder and choose 'file attributes' and set it to 777)
Next:
Login to Plesk
> Click Server on the left panel
> Click Scheduled Tasks
> Select the Root user
> Add New Task
Minute: 01 ( this means 01 minutes past the hour)
Hour: 02 (This means 02:00 AM)
Day of Month: * (This means every day)
Month: * (This means every Month)
Day of the Week : * ( This means every day)
Then for the command:
mysqldump --user=admin --password=youradminpassword --all-databases > /backup/mysqlall-`/bin/date +\%Y\%m\%d`.sql
That's for the database backup - This backs up ALL MySQL databases - for every website.
Now repeat and make another Scheduled task to backup all the web files for a certain domain:
You need this command:
tar -cvzf /backup/mywebsite.com-backup-`/bin/date +\%Y\%m\%d`.tar /var/www/vhosts/mywebsite.com/httpdocs
and finally
make a 3rd task that runs this command:
find /backup -mtime +5 -exec rm {} \;
This will delete any files older than 5 days.
Voila! A PROPER backup!
Oh yeah... if you try and put these together into a script file and try to cron run that... it doesn't work. no idea why.
This would have saved me 2 weeks!!!!
So Please don't remove it!
Will
In case you didn't know.. when you use the Plesk Backup Scheduer, it creates a file that apparently only Linux can unpack and is basically useless if you want to ever open the files on a pc.
So if, like me, you just want to be able to make a regular backup of your webisite files and it's databases you can do it like this:
First:
log into FTP using root user and go to the path /
Make a new folder called backup
make sure it has permissions set to 777
(most FTP programs you can right click the folder and choose 'file attributes' and set it to 777)
Next:
Login to Plesk
> Click Server on the left panel
> Click Scheduled Tasks
> Select the Root user
> Add New Task
Minute: 01 ( this means 01 minutes past the hour)
Hour: 02 (This means 02:00 AM)
Day of Month: * (This means every day)
Month: * (This means every Month)
Day of the Week : * ( This means every day)
Then for the command:
mysqldump --user=admin --password=youradminpassword --all-databases > /backup/mysqlall-`/bin/date +\%Y\%m\%d`.sql
That's for the database backup - This backs up ALL MySQL databases - for every website.
Now repeat and make another Scheduled task to backup all the web files for a certain domain:
You need this command:
tar -cvzf /backup/mywebsite.com-backup-`/bin/date +\%Y\%m\%d`.tar /var/www/vhosts/mywebsite.com/httpdocs
and finally
make a 3rd task that runs this command:
find /backup -mtime +5 -exec rm {} \;
This will delete any files older than 5 days.
Voila! A PROPER backup!
Oh yeah... if you try and put these together into a script file and try to cron run that... it doesn't work. no idea why.
This would have saved me 2 weeks!!!!
So Please don't remove it!
Will