PDA

View Full Version : Remote backup tool READY!


Dj-Grobe
12-17-2005, 04:59 PM
Remote Backup 1.0
Features (12-17-2005):
This util use native interworx backup
Transfer files using secure ssh to remote server
Little util for key server included
Report by mail when backup start, and report when finsih, with time date, and backup size included in the report

Auto rotate old backups:
Save copy last backup or save only current backup.
Optional safe mode, if backup fail, old backup not rotated or deleted.

Remote Backup 1.1
New features (05-01-2006):
Now you can configure folder where backup its saved.
Skiplist available, now you can make your own list of site or sites to skip in the backup. (selective backup)

Next version features ?
Just place your request and i try add feature requested.

About Rsync feature
Available in the future? NO... sorry! Why?
Simple: rsync its a little complex to backup and restore, and not really usefull when have 100% automatized hosting company with multiple domains per server, and system for enable, disable and delete accounts in automatic way.
With rsync, the backup continue saving domains already deleted of the servers, and need manual deletion of backups every few days for have correct and real copy of sites hosted on the servers. (this can be fixed but need extra code for check list domain hosted per servers, for compare with the domains on the backup etc etc)

Everybody say rsync its light backup system, yes !! that its real, specially for sueper big sites, if you have super big site, the best its use rsync, but you can continue using my backup tool with that domain skiped form the backup, and just configure rsync for that super big site.

The native backup Iworx used by my frontend its really light and not overload the server, in all my servers, the usual load its 1 to 1.2 runing the iworx backup the load just go to 1.86 to maximum 2 for about 1:30hour, and about rsync save band width, yes that its real, but at this moment server providers around the world offer great BW quota transfer to cheap price, so i really no think BW its a real trouble.
BW its your trouble? well i think the solution its second HARD DISK for daily backups, and one weekly or montly remotebackup.
For this reason i decide use Iworx native backup and create this frontend for improve the IWORX native backup usage. : )

--------------------------------------------------------------------------------------------------------


The idea of this backup is make this task automatic, programed in cron for save backup to remote server using ssh transfer.
You can configure daily in crontab or weekly, or montly.

Backup 100 normal sites, take about 1 hour (this time can change based on network speed, size of sites, number of files, cpu etc etc)

Install:

You need key your server using ssh, in this way backup program make automatic conection using ssh without need you enter root password or save roor password on any file.
This how to install, supose you have 2 servers and need backup server 1 to server 2 and server 2 to server 1.
Or backup server to any other server with ssh acces and root access.
Or backup to self server.

Step1
Install script on server you want perform backup:

mkdir /root/.bk
cd /root/.bk
wget http://ns3.zero-spam-tolerance.com/remotebackup.tar (http://www.interworxutils.cjb.net/remotebackup.tar)
tar xvf remotebackup.tar
nano -w config

IPREMOTE=
enter IP of remote server where backup be saved or self server IP.

EMAIL=
Enter email where you want recive reports of backup.

LASTBK=
With this option you can save one copy of last backup, or can disable and just only save fresh and current backup.
If you have free space for save copy, i recomend not disable and use default value, in this way you have oldbackup saved and current backup saved.

SAFEOLDBK=
This option save your old backup in folder named SAFEoldBACKUP before backup start, and delete when backup end.
If server crash in under the backup process, you have a copy of your old backup in SAFEoldBACKUP folder.
I add this option because rotation scheme i use is very simple and rotation fail if server crash.
If you not recive mail reporting backup finished, i recomend enter to folder where files backup are saved and chek if folder SAFEoldBACKUP exist.
MV folder to any other name, and rerun backup, if backup its completed then delete that folder.

PATHBK=
Just configure the pat you want use for save the backup on remote server, you no need cerate folder, the backup create the folder if no exist.


Step2
This util make by default complete server backup (all domains) if you need skip/exclude domain or multile domains from the backup, just edit file skiplist, and add the doamins you want skip, one per line, example:

domain1.com
domain2.com

Aditional to domains list, you can filter the backup, based on the TLD, if you no want backup some specific TLD domain, you can add to skiplist that TLD, example, just add to skiplist:

.tv
.biz

This, make backup skip/exlude all domains .tv and .biz


Step 3
Now is time key your servers:

Run this command on server want backup and server where you the backup its saved.

ssh-keygen -t rsa

Press enter 3 times, use empty frace for key.
(If you already have key created just overwrite)

Now o run the util for key server:

./keyserver

This util just copy they key to remote server, the util ask for root password of remote server where you save backup, enter password and press enter.
For check if the server is correct keyed, just run:

ssh root@IPofremoteserverhere


Run hostname for see if you stay loged on remeote server correctly, if all is ok, just run exit for back.

(you can key self server if no plain make remotebackup)


Step4:
Add to cron the backup, daily or weekly:

nano /etc/crontab


For daily at 1 AM add:

02 1 * * * root /root/.bk/remotebackup > /dev/null 2>&1

For weekly at 1 AM add:

22 1 * * 0 /root/.bk/rootremotebackup > /dev/null 2>&1


I sugest not run at 4am because server perform other task, and you can probably overload your server.
Dont forgot change path /root/.bk/ to path where you decide locate the backup util.

If want run your fist backup manually just type:

./remotebackup

By default, backup files are saved on /root/.bk folder of remote server, or self server if you decide make backup to self server, remember you can change that path or can use the default.


Well i hoppe this be util for somebody. I not are programer, so this is very simple but work ok.
This backup make complete backup of all sites, and no use rsync, take care with BW used if run daily.
My native language not is english, sorry if my spell no is correct !

Paypal donations: groovedj@hotmail.com : )


Best regards! and enjoy !

Dj-Grobe
12-24-2005, 03:57 PM
If anyone download and use script prior day 23 december, please download script again, because i find error in rotation logic.
Now its fixed.
Extract and overwrite only file remotebackup

Best regards.

pascal
12-27-2005, 06:41 AM
Bravo Dj-Grobe

I did explain how to do this manualy
http://www.interworx.com/forums/showthread.php?t=493

But it's very cool to have this done automaticly and to have the auto rotate ability.

I'll test it soon...

Did you thing about the few boxes backup to ONE remote place ? (I think about the key merge on the remote boxe )

Pascal

Dj-Grobe
12-27-2005, 07:05 AM
You cant backup multiple boxes to only one remote box.
The trouble its the backup system i create, save backup on /root/.bk / folder of remote box, if you plain multiple boxes to only one, that can be a trouble.

Gimme few days an i add option for choice in configuration, the name of folder and complete path where the backup be saved on remote server.
I know that limitation when i start, but no have a lot of time, for that reason publish the backup on this stage.

The first week of 2006 i add that features, if have some free time i make this week.

About the key, i add the merge option soon for case you coment.

Best regards.

pascal
12-27-2005, 07:21 AM
Well for me everything already work (less the auto rotate, I first delete everything on the remote server, then backup) but for the community and a general use, it could be great to have this, yep.

Thanks Dj-Grobe

Pascal

int
03-15-2006, 02:58 PM
Well for me everything already work (less the auto rotate, I first delete everything on the remote server, then backup) but for the community and a general use, it could be great to have this, yep.

Thanks Dj-Grobe

Pascal

This is very interesting to me - this is exactly what I was looking for.

I just got backup storage space through RSYNC or SCP and I was looking for a script that allowed for a full backup of only relevant info from my IWorx box.

Is the method outlined above a quick, safe, thorough way of backing up my box? Or is using the .pex backup method that I saw on the forums a better way (http://interworx.com/forums/showthread.php?t=1047&highlight=backup)

Any advice would be appreciated!

Thanks.

Justec
03-15-2006, 04:03 PM
Int,

I think if you do Rsync its better to just do it by file and not use the InterWorx backup.pex. This way you dont..
1) Waste CPU time TGZ'n each siteworx account
2) Waste BW to transfer unchanged files

My ideal situation will be to do weekly (or even daily since it should be rather quick) SiteWorx "structure" backups. This way I could restore SiteWorx accounts if I had a complete hard drive failure. I would then use my daily Rsync backup to copy back over the data files (ie. /html, etc.) and the /var/lib/mysql files. Now this would work restoring to the same system (Same version of software like mysql, iworx, etc.). If you need a backup to move to a new system it would be better to just do a full Iworx backup.

So hopefully in the next 2.2 release the structure only backup will be incorporated. Also, if you need anyone to test this structure only backup I wouldn't mind getting a preview of the new backup.pex :)

Dj-Grobe
04-13-2006, 02:56 AM
New version soon, but not rsync, i continue using native interworx backup.

Soon i work on rsync version....but i need time !!......

The new version its a little modification for enable selective backup, not just all backup.
With selective backup you can skip domains you add to skiplist.

Aditional to that better rotation scheme and some changes for improve the backup.

I try back soon with new version, but have lot of work here, so please have patience.

WebXtrA
04-17-2006, 04:57 AM
I can't download http://www.interworxutils.cjb.net/remotebackup.tar (http://www.interworxutils.cjb.net/remotebackup.tar) :(

Dj-Grobe
04-22-2006, 05:45 AM
Ups!!!, the link of download its down, after this weekend i have the new version working and make public new link for download.
Sorry for delay to repply WebXtrA

WebXtrA
04-22-2006, 07:50 AM
Okay, no problem. I got a work arround thanks to Socheat.

Thanks

Dj-Grobe
05-01-2006, 05:54 PM
Sorry for this big delay, very bussy here.
Well, the new backup version its ready, original post updated please read !.
Download link updated and working.

Enjoy!

WebXtrA
06-04-2006, 08:07 AM
Hello,

I was wondering if it's possible to backup 1/3, 1/4 etc. of all the accounts.
This looks like a wierd question, but I'll explain:

We are certified by "Hostmerk", it's a Dutch entity that ensures that a HSP/ISP has been checked that it has certain hardware, procedures etc. so that prospects/customers know that they are dealing with a company that has a certain quality level.

One of the things is that every single account has to backed up to an external server every day.

At this moment our cluster is backing up sites every day from 0:00h untill +/- 12:00h, so that takes about 12 hours to backup all the accounts.

I would like to have all the nodes do a portion of the backup, so that the backup will be done much quicker and because it doesn't put a heavy load on our Cluster Manager for almost 12 hours.

By the way, this is what I use now to backup:

#!/bin/sh
/home/interworx/bin/listaccounts.pex | awk '{print "/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=" $2}' >> /root/scripts/backuptoday.sh
sh /root/scripts/backuptoday.sh
rm -f /root/scripts/backuptoday.sh

backuptoday.sh then has lines like these, to backup all the accounts:
/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=domain1.com
/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=domain2.com
/home/interworx/bin/backup.pex --ftp --transfer-ini=/root/transfer.ini --domains=domain3.com

etc.

Greets,

Rámon

Justec
06-04-2006, 02:19 PM
In the next release of Iworx they will offer a structure only backup which will just backup the SiteWorx account settings. This then leaves you to backup the data itself.

Intead of using the Iworx full backup to do the nightly backup I suggest you use Rsync. Doing this will save time b/c only files that are changed (and I think just the bits that are changed) are sent to the remote backup server. Plus there is no compression (tar.gz) so it will have a lighter CPU load while running. This could dramatically cut down on the backup time. But you may have to wait until the structure backup is out so you can also get the siteworx settings like the email boxes etc.

WebXtrA
06-04-2006, 02:37 PM
Thanks for your reply.
The only problem with rsync is that it doesn't delete files which were deleted in the source folders. Meaning that the backup will contain every single file that once was there.

I don't know if the structure backup will also backup the databases of a siteworx account? Because these change every day and sometimes it is nessicary to have a backup of 2 days ago because a customer did something wrong the day before yesterday and finds it out today.

Also the ease of restoring a site is much better with a full backup.

I'm looking into if I can just count the lines in backuptoday.sh devide that trough X and then make multiple backuptoday.sh (backuptoday1.sh, backuptoday2.sh etc.) scripts containing only the first lets say 200 accounts, second 200 accounts etc.

Node 1 will excecute backuptoday1.sh; backing up the first 200 accounts, Node 2 will excecute backuptoday2.sh backing up the second 200 accounts etc.

It should be possible, but don't know how yet.

Justec
06-04-2006, 03:25 PM
Thanks for your reply.
The only problem with rsync is that it doesn't delete files which were deleted in the source folders. Meaning that the backup will contain every single file that once was there.
--delete: delete files that don't exist on the sending side

I use "rsync -a --delete source dest" or "rsync --rLptgoD --delete source dest". The difference between -a and -rLptgoD is that -a is equal to -rlptgoD (little L) and the big L will copy symlinks as files and where the little l will copy just the symlinks.

I don't know if the structure backup will also backup the databases of a siteworx account?
I believe this is what a structure backup does, it backs up all the settings (ie database) of a particular siteworx account. So first you would restore the structure backup and then restore data from the rsync backup.

Iworx Question
If you restore a siteworx structure backup on top of an existing siteworx account will it only update the database and leave all current files in place? Like lets say they deleted an email account and then you restored the struct backup, this wouldn't effect the other mailbox data thats there or HTML stuff correct? Just after restoring the struct backup you would have to copy over the /home/site/var/site/mail/mailboxname folder correct?

Because these change every day and sometimes it is nessicary to have a backup of 2 days ago because a customer did something wrong the day before yesterday and finds it out today.
I couldn't agree more. I keep 5 days of backups with rsync. Here's a sample of what I do:echo "1 -> 2"
rsync -a --delete /backup/1/* /backup/2

echo "0 -> 1"
rsync -a --delete /backup/0/* /backup/1

rsync --rLptgoD --delete source /backup/0

Also the ease of restoring a site is much better with a full backup.
The way I look at it its not really that much more difficult or time consuming using rsync for data, but this is something that is more of personal preference rather than fact. As it stands right now there is no doubt that its easier with Iworx backup vs rsync, but with the introduction of a structure only backup then all you will have to do is restore the data which can easily be done with cp or rsync. You could even right a restore script to make it easier.

Also, what I really like about rsync data backup is something you pointed out earlier. If a client messes something up on lets say a HTML file they have. You can go to the rsync backup for whichever of the "5" days you have and restore that single file. You would be able to do this with Iworx full backup, but you'd have to do it manually by unpacking the tgz file.

As to your idea of splitting it up it sounds like it should work, but I dont know so I will let someone else address that.

WebXtrA
06-04-2006, 03:26 PM
OK, this is what I did, works for me (maybe DJ-Grobe can implement something similat in his script ;-)

I changed the script a bit and now its this:
############################

#!/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/backuptoday.sh
split -l 200 /tmp/backuptoday/backuptoday.sh /tmp/backuptoday/
sh /tmp/backuptoday/aa
rm -rf /tmp/backuptoday

############################

the only thing I have to change on the nodes is the "sh /tmp/backuptoday/aa" line, since split, splits the files and writes them away as aa, ab, ac, ad etc.

It's not really automatic and I have to keep track of the amount of accounts etc. but it works for me ;-)

Justec
06-04-2006, 03:30 PM
I would be interested to know how this helps out with your overall time to backup.

WebXtrA
06-05-2006, 05:11 AM
Well since it takes 2 - 3 hours to backup 200 sites (approx.) every server is busy for 2 - 3 hours in stead of one for 12 hours, it will now take 2 -3 hours.

But it doesn't work.... Since the databases are on the cluster manager and the nodes try to connect to the local mysql database when it is making a backup.

So I guess I'm going to try your suggestion.

sliqua
06-07-2006, 07:38 AM
What is a working download link for this backup script?
-a

WebXtrA
06-09-2006, 07:30 AM
This:

echo "1 -> 2"
rsync -a --delete /backup/0/* /backup/1

echo "0 -> 1"
rsync -a --delete /backup/0/* /backup/1

rsync --rLptgoD --delete source /backup/0

Should be:

echo "1 -> 2"
rsync -a --delete /backup/1/* /backup/2

echo "0 -> 1"
rsync -a --delete /backup/0/* /backup/1

rsync --rLptgoD --delete source /backup/0

Right?

I read in this post: http://interworx.com/forums/showthread.php?t=1047&highlight=backup

That the structure backup does *not* backup databases.
You need to use the --database option to only backup databases:
http://interworx.com/forums/showthread.php?t=1405&highlight=backup+database

So I have to write a script that first remotly rsyncs /home, then does the structure backup and then the database backup. It's going to be fun ;-)

Too bad that this structure backup is not available at the moment :-(

Justec
06-09-2006, 10:38 AM
echo "1 -> 2"
rsync -a --delete /backup/1/* /backup/2

Thats right, thanx for pointing that out!

That the structure backup does *not* backup databases.
Right it does not backup user database, just SiteWorx account info (Iworx database).
But what I do now (and will do with struct backup) is to backup the /var/mysql directory.
So I can restore all the database info by copying back the DB files back into /var/mysql.

Now the downside to that is if you have a crash and move to a new system with a different version of MySQL you may not be able to open the /var/mysql files in the new version.
I'm not sure how Iworx backups the database, but if its more of an export of all the commands (dump or whatever) to rebuild the database that would be better for moving from one verion to a newer one.
Iworx guys can you confirm how the Iworx user database backup works?

But worse case secnerio using /var/mysql is you just load them on a a testbed with same version and dump them to text files, then use those to import them to new system, most important thing is to have the data backed up in some form :)


Too bad that this structure backup is not available at the moment :-(Yeah, but my guess is that it will be out in the next 4-6 weeks just based on my own speculation from things I've picked up around the forum.

WebXtrA
06-09-2006, 07:51 PM
Well as far as for the DB backup.... I could use mysqldump to just dump all the DBs as SQL files.

Or I can download sysbackup from R-F-X Networks and let that handle the database backup. (That's what I do with our Ensim servers).

Maybe I should just try the database only backup from Iworx to figure out what kind of backup files we will get :rolleyes:

So I'll be all set when that structure backup is out :cool:

WebXtrA
06-17-2006, 08:24 AM
One more question.

I'm getting these errors when I rsync:
symlink has no referent: /home/siteuser/something
And things like this
rsync: readlink "/home/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/cron/rrd.pex" failed: Too many levels of symbolic links (40)

This is the command I use:
rsync -rLptgoDv -e "ssh -i /root/.ssh/backup-rsync-key" /home/* backup@10.10.10.1:/backup/rsync/1/cpserver/home

Don't know if that's a problem.

What do you do when you have to restore an account?
1. Create the account?
2. Create DB users?
3. Import DBs?
4. Create mailboxes?
5. Rsync the data back?

And then for 5, do you Rsync it back like this:

rsync -rLptgoDv -e "ssh -i /root/.ssh/backup-rsync-key" backup@10.10.10.1:/backup/rsync/1/cpserver/home/siteuser/* /home/siteuser/

?

Dj-Grobe
06-19-2006, 12:35 PM
About my backup i want inform i never add oprion for rsync,...... this is a full backup system.
After years working with hosting i see the best way to make backup its just make 100% full backup.

I have powerfull servers, and usually take just 2hs for 250 sites,with load about 1.8
That its low load.
I run mabkups in the midlle of the night, the load created from the backup..... little extra load ......its compesated with low activity on server.

Why i should use rsync whe i have:

FASTER CPU SERVERS
BIG HD ON SERVERS
NO METERD NETWORK

This 3 points , makeme work with full backups.



WebXtrA, please explain waht feature you need, and i try add.

Justec
06-19-2006, 01:23 PM
Why i should use rsync whe i have:

FASTER CPU SERVERS
BIG HD ON SERVERS
NO METERD NETWORK

* Unnecessary wear and tear on hardware
* Extremely inefficient

Having a big hard drive makes not difference, actually since you are TGZ'n you would need a smaller drive. The networkk only matters if you are using a remote backup and wether or not you have un metered 100 mbit/sec backup is pretty slow and you would want to transfer the least amount of bits as possible.

Of course every person does what the feel is best for them so whats good for me might not be good for you.

Justec
06-19-2006, 01:35 PM
symlink has no referent: /home/siteuser/something
This happens if you have a symlink that points no where. SSH and go to the "something" and this is most likely the problem. It's basically like having a windows shortcut to nowhere.

rsync: readlink "/home/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/interworx/cron/rrd.pex" failed: Too many levels of symbolic links (40)
Never seen this one before, but maybe you have a symlink pointing back to itself? So it gets caught in a loop?

What do you do when you have to restore an account?
1. Create the account?
2. Create DB users?
3. Import DBs?
4. Create mailboxes?
5. Rsync the data back?

I never had to do a complete restore on an account using an Rsync backup, but your list looks right. You would basically have to restore all the SiteWorx parts of the account before restoring the data.

The only thing Im not 100% sure how I would handle is symlinks. I use the big L because I want to make sure I have the actual data if the symlink is pointing to a directory on the hard drive Im not backing up. I'm not exactly sure how rsync handles this, but my main concern is having the data, everything else can be reconfigured/rebuilt (at the cost of time). So when you restore you will be restoring the actual file so you may have to manually move that file to its original loaction and re-symlink it. I'll have to do some test and see how rsync handles that.

Dj-Grobe
06-19-2006, 03:30 PM
Justec, sorry but 100% full backups, in my case its the best.
Backup and Retsore are 100% fiable and automatic.
My web hosting company its 100% automatized, included orders, activations, payments, suspend account, delete account, enable accounts, upgrade accounts etc etc.

Time ago i use rsync backup, but i need check all time when sites are automatic deleted form servers (no pay customers), for delete that sites of the backups!! and belivme when you have high number of servers with 250 sites per server, this its really big nightmare chek all days what sites should be deleted, in the rsync backup.

I have multiple servers, i not host 100 or 200 sites on one server........i have lot of servers with 250 sites per server.

Sorry bur on my case, the best backup its 100% backup.

When runing backup, on rare situations cpu load go to 1.8 usually its 0.9 to 1.2 when run backup, and no create any torubles, i use this backup schema for the last 6 months on interworx with 0 trouble.
And on ensim servers in the last 4 years.

In some situations i think rsync can be used,specially when volume data to backup its very very high....
For me its perfect : )

For people with not faster servers, bw restricted, low space for storage, and when need save 7 days backup or more.......yes, this backup way its not usefull and rsync its better.

Best regards.

WebXtrA
06-20-2006, 11:33 AM
Hi Dj-Grobe,

Thanks for your reply.

Don't get me wrong, I prefer a full native Iworx backup above the solution that I'm using now.

We got an Interworx cluster with only AMD Optron 165 and dual Xeon 2,8 Ghz or better systems with at least 2Gbyte Ram.

We have to create daily external backups (on a different server than the servers where the sites are hosted on) due to a certain certification of our company.

With full backup it takes about 10-12 hours to backup 500 sites (50Gbyte or more) to the external server. It takes so long in my opinion do to the fact that the backups have to be tgz'ed.

So what I would like to do is to use all the servers within the cluster to make backups (like 200 sites per server), so that they all do a bit.

I tried to do this with the native interworx backup.pex solution, but ran into the problem that it doesn't make the backups because it can not connect to the database (it tries to connect to localhost but it should connect to the Cluster Manager or dedicated database server) and therefor doesn't backup anything and gives an error.

I would be greatefull if you could implement a solution so that I can created backups on the nodes.

Thanks,

Rámon

Dj-Grobe
06-20-2006, 11:38 AM
I understand ...... and like i say....in your case the solution its ONLY RSYNC.
That i say on my post, rsync its the only solution when have big size backup.

Full backup its ok just for normal host services, were you usually have just a no more of 5gb in backups for complete server.

You try open ticket to iworx for this?

The trouble its fault on native backup feature.
I think iworx guys should fix this.

Best regards.

WebXtrA
06-20-2006, 11:56 AM
I opened a ticket for this, but I'll have to wait for the structure-only backup.

What I do now is:
1. Rsync /home to an external backup server
2. Create database backups with the native Iworx backup
3. Create Mail backups with the native Iworx backup
4. Created a Rsync backup rotation script on the backup server, so I can go back multiple days.

When I need to restore an account I do it like this:

1. Create the account.
2. Import the database and mail backup.
3. rsync everything in the html dir.
4. chown everything in "html" to the siteworx user.
5. Verify with the customer which subdomain he/she had and recreate them.
6. Verify with the customer what kind of crons he/she had and recreate them. (don't know if structure-only makes a backup of this)
7. Change permissions for dir's and files if needed.
8. Recreate forwarders, mail groups and aliasses (don't know if structure-only makes a backup of this)

Steps 1 and 5 (and 6 and 8) will be skipped when the structure-only backup is there.

EDIT: Forgot some things.

IWorx-Tim
06-20-2006, 06:07 PM
4. chown everything in "html" to the iworx user.

The iworx user does not own the contents of the html directory, the siteworx account's unique system user does (first 8 characters of domain name) [/quote]

WebXtrA
06-21-2006, 04:01 AM
The iworx user does not own the contents of the html directory, the siteworx account's unique system user does (first 8 characters of domain name)

That's what I meant :rolleyes: , changed it in my post now. Thanks for correcting.:)

By the way, regarding:

6. Verify with the customer what kind of crons he/she had and recreate them. (don't know if structure-only makes a backup of this)
8. Recreate forwarders, mail groups and aliasses (don't know if structure-only makes a backup of this)

Does the structure only backup makes a backup of this?

kipper3d
07-11-2006, 08:13 AM
This cronjob doesnt seem to work:

root /root/.bk/remotebackup > /dev/null/ 2>&1

What is this portion for:
> /dev/null/ 2>&1

and why root before the path? Doesn't cron normally run as root?

Works just doing /root/.bk/remotebackup

Thanks,

Dj-Grobe
07-25-2006, 10:49 AM
If work using /root/.bk/remotebackup , you cna use on that way.
Sorry for later repply.

kipper3d
07-26-2006, 11:21 PM
That doesnt seem to work either.

Why doesnt the cron you suggest work? Is it because /dev/null isnt setup?

I've been having to run these backups manually.

ctalavera
08-06-2006, 01:43 PM
I would love to use this script unfortunatly I dont use default ssh ports on my servers. Any chance you will be adding the ability to add a port anytime soon?

kipper3d
08-06-2006, 01:51 PM
Hello ctalavera,

You can already open and close ports in the firewall link in nodeworx.

ctalavera
08-06-2006, 01:58 PM
Actually I meant setting a port in the script to connect to. Right now you can only set a IP address. So it assumes you are connecting to port 22 on the server you are backing up to. I use different ports on my server for ssh.

IWorx-Tim
08-07-2006, 02:59 PM
If you are asking if the new version of Iworx will be able to change the SSH port to something other than 22 then the answer is no. HOWEVER there are no problems with changing the port manually as long as you open the new port in the firewall and the ports listed in the main NodeWorx screen are hard coded so they won't be updated.

We may at some point make it possible to change default ports on services through the software itself but would need to write it so that the firewall was automatically updated as well to keep people from being locked out of their boxes.

EDIT: nevermind, I guess you weren't asking this at all.

ctalavera
09-08-2006, 01:12 AM
Actually what I was saying was that the server I backup to on a daily basis doesnt use port 22 for ssh. The IWorx server would remain on port 22 for ssh.