store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Sat Apr 19, 2014 10:31 am

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Tue Apr 24, 2012 7:59 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Sat Aug 20, 2005 9:30 am
Posts: 2812
Location: The Netherlands
nobody wrote:
breun wrote:
I recommend not trying to be smart about what directories to backup, but just backing up all regular partitions.

I don't recommend backing up the files in /var/lib/mysql though, at least not as your primary way to back up MySQL databases, as they are not guaranteed to be in a consistent state when you back them up. I recommend doing SQL dumps and backing up those.


I am not trying to be smart.
Code:
http://kb.parallels.com/en/819


It is pointless to backup the OS. The point of backup is in case of a disaster such as hardware failure or in the event a site was hacked to be able to restore recent data and in the fastest possible time.


I don't think it's pointless to backup the OS. You might not need those files when you need to rebuild a server, but in case something goes wrong (an RPM install for instance), a file gets corrupted, a file's contents look weird, you suspect permissions have gotten modified somehow, etc. it's always great to be able to go back to the backup of any file on the server. BackupPC's hardlinking and compression features allow us to store full backups for lots of servers on a single BackupPC server, so we default to backing up everything.

_________________
Lemonbit Internet Dedicated Server Management


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Tue Apr 24, 2012 4:51 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 2007
Um.....mounted volume disk snapshot: http://www.r1soft.com/tools/linux-hot-copy/

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Wed Apr 25, 2012 2:06 am 
Offline
Forum User
Forum User

Joined: Tue Apr 20, 2010 2:49 am
Posts: 74
And for the databases : http://www.percona.com/doc/percona-xtrabackup/

(Which sounds like how r1soft do their MySQL backups).


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Fri Aug 17, 2012 9:20 am 
Offline
New Forum User
New Forum User

Joined: Sat Jul 07, 2012 11:33 pm
Posts: 3
Location: Dallas, Texas
Hi all. I'm running Plesk 9.5.4, and am having issues with Plesk not removing old backups. Troubleshooting this, I deleted some of the backup data files from the command line (just the .tgz files), and I think now things are out of sync between the backup data files and their related info.xml files.

Is it possible to just delete everything in var/lib/psa/dumps/ and start over?

I've looked in the psa database for records corresponding to individual backups, but I can't find one. So I think the only info in the database is the backup schedule and currently executing backups - not a record for each individual backup. My assumption is that if I wipe it all out, Plesk will recreate directories for clients/domains/.discovered, etc. as necessary when I run new backups. Anyone ever tried this? If so, please post back if there are any problems.

Just to be clear, I'm thinking about running rm -R * from the /var/lib/psa/dumps/ directory.

Thanks in advance!
Scott


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Sat Aug 18, 2012 8:01 am 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 350
I have the solution for you ! You see plesk backups are not stored in any way in the plesk datrabase. Plesk "reads" backups from the xml files it generates. There is only one clean way to delete them.

Code:
find /var/lib/psa/dumps -type f -mtime +7 -delete -print

This command will delete all files which are older than 7 days in the /var/lib/psa/dumps folder. YOu may adjust the number as you wish.

Hope I've helped.

Take care

cmpreshn wrote:
Hi all. I'm running Plesk 9.5.4, and am having issues with Plesk not removing old backups. Troubleshooting this, I deleted some of the backup data files from the command line (just the .tgz files), and I think now things are out of sync between the backup data files and their related info.xml files.

Is it possible to just delete everything in var/lib/psa/dumps/ and start over?

I've looked in the psa database for records corresponding to individual backups, but I can't find one. So I think the only info in the database is the backup schedule and currently executing backups - not a record for each individual backup. My assumption is that if I wipe it all out, Plesk will recreate directories for clients/domains/.discovered, etc. as necessary when I run new backups. Anyone ever tried this? If so, please post back if there are any problems.

Just to be clear, I'm thinking about running rm -R * from the /var/lib/psa/dumps/ directory.

Thanks in advance!
Scott

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Tue Aug 21, 2012 3:45 pm 
Offline
New Forum User
New Forum User

Joined: Sat Jul 07, 2012 11:33 pm
Posts: 3
Location: Dallas, Texas
Thanks! That worked well.

I'm still trying to find out how I can get Plesk to enforce the backup limits that I have listed in the Backup Settings. Some domains I would like to keep longer than others, so if the "Limit backups" setting worked, that would be much better. So far I can't find out where it is failing.

Does anyone know the location of the script that should be removing the old backups? Everything else is working fine for me. Plesk backs up on schedule as expected to local repository. It just doesn't remove the out of date backups. If I knew where the script was I could probably track this down...


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Wed Aug 22, 2012 1:27 pm 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 350
cmpreshn wrote:
Thanks! That worked well.

I'm still trying to find out how I can get Plesk to enforce the backup limits that I have listed in the Backup Settings. Some domains I would like to keep longer than others, so if the "Limit backups" setting worked, that would be much better. So far I can't find out where it is failing.

Does anyone know the location of the script that should be removing the old backups? Everything else is working fine for me. Plesk backs up on schedule as expected to local repository. It just doesn't remove the out of date backups. If I knew where the script was I could probably track this down...


Plesk backup is a pain in the *** ... I've tried many things. Didn't find a solution. The only solutions are the following.

1. Take backups with custom scripts and rsync them somewhere. But its not guranteed that when you bring back the backups it will work ... Maybe you can take backups in the local repository and then rsync this whole folder somewhere ... I've done this as well.

2. There are also some commercial solutions but cost a lot and they require that you have another server just for taking the backups.

Generally I've always had problems with plesk backup. I still have. If you have a server with approximately 50GB backup you have a real problem. The plesk backup utility was not built for large backups and servers with many domains.

Cpanel has a nice backup utility. Has its own issues but it works better and smoother for the server. I haven't come across any other solutions to be easy, cheap and work better. If you find any solution though please share it with us. We are all looking for a better solution I believe.

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Thu Aug 23, 2012 12:28 pm 
Offline
New Forum User
New Forum User

Joined: Sat Jul 07, 2012 11:33 pm
Posts: 3
Location: Dallas, Texas
Yeah. I've been RSYNC-ing /var/lib/psa/dumps to our local fileserver here - when that started taking longer than it should was when I noticed older backups were not deleting as they should. Thanks a ton for your help though. I'll post back if I find any answers. My only guess at this point is that there is a permission problem preventing the PSA backup manager from deleting old backups. I'm going to try and hunt that down...


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Thu Aug 23, 2012 2:37 pm 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 350
cmpreshn wrote:
Yeah. I've been RSYNC-ing /var/lib/psa/dumps to our local fileserver here - when that started taking longer than it should was when I noticed older backups were not deleting as they should. Thanks a ton for your help though. I'll post back if I find any answers. My only guess at this point is that there is a permission problem preventing the PSA backup manager from deleting old backups. I'm going to try and hunt that down...



Put in your crontab script first the command that deletes old backups and you should be fine !

Yes if you find a better solution please let us know :)

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: Plesk backup killing the server
Unread postPosted: Thu Oct 04, 2012 1:58 pm 
Offline
Forum User
Forum User

Joined: Wed Jan 05, 2011 3:09 pm
Posts: 39
We use rsnapshot to do pull style backups from servers - it has a nice feature where it can trigger a script before a backup - as such we use a script to trigger mysqldumps on a per table basis to avoid locking tables too much just before we do the backup.

Simple script that will work on most plesk servers to backup databases on a per table level:


Code:
#!/bin/bash
export savepath='/usr/mysqlbackups'
export usr='admin'
export pwd=`cat /etc/psa/.psa.shadow`
if [ ! -d $savepath ]; then
    mkdir -p $savepath
fi
echo 'mySQL Backup Script'
echo 'Dumping individual tables..'
for a in `echo 'show databases' | mysql -u$usr -p$pwd | grep -v Database`;
do
  mkdir -p $savepath/$a
  echo "Dumping database: $a"
  for i in `echo 'show tables' | mysql -u$usr -p$pwd $a| grep -v Tables_in_ |sed -e 's/ /_/g'`;
  do
   echo " * Dumping table: $i"
   mysqldump --compact --skip-opt --add-drop-table --allow-keywords -q -a -c -u$usr -p$pwd $a $i > $savepath/$a/$i.sql
  done
done


So rsnapshot triggers this, and then its next command is to backup the directory /usr/mysqldumps or such

rsnapshot does incremental backups by using hardlinks between the folders so you only use space for changed files rather than storing the same file over and over again. still uses rsync under the bonnet to do transfers.

Another method ive played with very lightly is csync2 and lsyncd - csync2 can send files to more than one location at once - offsite and local backups for example - combined with lsyncd it can monitor and do this as soon as any files change. theres a good article on this at https://www.axivo.com/community/threads ... syncd.121/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group