Best way to do server wide backup....

Hi there,

I know this is not a CP question per say, but I want to know the best way to back up all of my user accounts and there MySQL DB’s. I don’t care about Interworx account info per say though if I could back that up that would be great. What I am more interested in is backing up all the accounts files and the MySQL DB’s.

Can Anyone recommend the best way to do this? Oh and I would only want to do this every week or so.

[SIZE=1]
#!/bin/sh
/home/interworx/bin/listaccounts.pex | awk '{print "/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=" $2}' >> /tmp/backuptoday/full.sh
mkdir /tmp/backuptoday
sh /tmp/backuptoday/full.sh
rm -rf /tmp/backuptoday
[/SIZE]

That’s what we use to backup all the domains on one server.

transfer.ini looks like this:

[SIZE=1]
[siteworx.backup_transfer_data]
username="backupuser"
password="password"
hostname="111.222.333.444"
remotefile="/backup/1/"
[/SIZE]

Thank you kindly for this.

I do this to make a backup of critical stuff…

nice -n19 tar cvfz /BACKUPS/date +%e-%b-%g.tar.gz /root /chroot /etc /usr/local

this backs up pretty much all the important stuff even outside of Interworx… perhaps a more unix savvy person can help expand on this.

Cliff.

You’re welcome :wink:

I am not doing any interworx backups… , but just wonder how this could work?

Shouldn’t the “mkdir” come before “/home/interworx/bin/listaccounts.pex | awk …” ?

:eek:
jup you’re right:rolleyes:

correct code:


#!/bin/sh
mkdir /tmp/backuptoday
/home/interworx/bin/listaccounts.pex | awk '{print "/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=" $2}' >> /tmp/backuptoday/full.sh
[LEFT]sh /tmp/backuptoday/full.sh[/LEFT]
rm -rf /tmp/backuptoday

I know this has been talked about in other threads but there is a new backup feature with interworx in the upcoming release where you can backup your SiteWorx structure (all settings and email accounts etc.) but no data. This leaves you open to backup the data using rsync. This has 2 pluses in my book 1) instead of backing up all the files everytime you only backup changed files (and i think maybe just the bits in the file that changed?) and 2) the interworx backup compresses the backups into a tgz (which put a good load on a CPU).

Also don’t forget to make backups of the customers databases.

Yes, obviously.
The rsync passes the checksums of small file areas (a few bytes) between the server and client to find the differences. If the checksum match, that content doesn’t get sent.

E.g, You just add a small entry in your blog (assume it is a plain html file) and the rsync backup would only transfer the recent data added (provided you already have rsync backup upto the previous entry).

BTW, I haven’t (yet) used rsync myself.

PS: Initially I thought why the “rsync guy” (justec :slight_smile: hasn’t come yet to this backup thread. And now he has.

jup you’re right:rolleyes:

correct code:


#!/bin/sh
mkdir /tmp/backuptoday
/home/interworx/bin/listaccounts.pex | awk '{print "/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=" $2}' >> /tmp/backuptoday/full.sh
[LEFT]sh /tmp/backuptoday/full.sh[/LEFT]
rm -rf /tmp/backuptoday

[/QUOTE]

I have received the following in my reply notification email:


WebXtrA has just replied to a thread you have subscribed to entitled - Best way to do server wide backup.... - in the General Discussion forum of InterWorx.

This thread is located at:
http://www.interworx.com/forums/showthread.php?t=1535&goto=newpost

Here is the message that has just been posted:
***************
:eek: 
jup you're right:rolleyes: 
 
correct code:

Code:
---------
#!/bin/sh
/home/interworx/bin/listaccounts.pex | awk '{print "/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=" $2}' >> /tmp/backuptoday/full.sh
mkdir /tmp/backuptoday
sh /tmp/backuptoday/full.sh
rm -rf /tmp/backuptoday
---------


***************


There may be other replies also, but you will not receive any more notifications until you visit the forum again.

All the best,
InterWorx

Note the “mkdir”'s position in the email compared to the original post (#7) which hasn’t (yet) been edited by WebXtra.

How come?

[QUOTE=tiger;9497]PS: Initially I thought why the “rsync guy” (justec :slight_smile: hasn’t come yet to this backup thread. And now he has.[/QUOTE]Haha, so now im the rsync guy :cool:

[quote=tiger;9499]Note the “mkdir”'s position in the email compared to the original post (#7) which hasn’t (yet) been edited by WebXtra.

How come?[/quote]

Well, I just changed my post after I posted it :wink:

Which I do a lot to change minor errors , just like this one.

As I have already told, I haven’t seen (and still don’t see) any “Last edited by” in that post (#7). (as you can see “Last edited by Justec :” in post #8)

That is, when you edit a post within one minute.
But I think that we are going a bit offtopic here.