Forum Moderators: phranque

Message Too Old, No Replies

Incremental Server Backup advice

         

buildersweb

2:05 pm on Jul 27, 2010 (gmt 0)

10+ Year Member



I want to discuss about which is the best way to take back up from server to local pc .

I have set up the backup settings to take every day incremental backup. So this option takes backup without compress (it replaces only the accounts i have altered).

The question i have is when i download this from an sftp client like filezilla it takes ages ... because it has to open all folders ...

Is there any easiest way to download it ?

I thought that i may use putty and create a bat file that runs some commands like compress that folder and download the zip file . Is that the best waY?

How can i download form filezilla fast non compressed files?

Thanks for your help...

lammert

2:54 am on Jul 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi buildersweb, thanks for bringing this item up. Making backups of your server is an important administration task.

What are the operating systems on the server and the local PC? The best options depend on the operating system running on those two. Based on the programs you mention I would say Linux server side and Windows client side.

Do you rent a full/VPS server or is this on shared hosting? With a full/VPS server you can automate some tasks with a scheduled task which runs every day to create a compressed archive, leaving only the transfer of the files to the local PC as a manual task.

buildersweb

7:12 am on Jul 28, 2010 (gmt 0)

10+ Year Member



The operating system on the server is Linux and on the local pc is windows xp.

I rent a full VPS server. i have cpanel and WHM but i also have access via putty ..

How can i create automate tasks ?

Thanks

phranque

9:10 am on Jul 28, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



does the crontab command work for you?

buildersweb

9:37 am on Jul 28, 2010 (gmt 0)

10+ Year Member



crontab?

lammert

9:52 am on Jul 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Cron is a process running on your VPS server which calls specific tasks at scheduled moments. The main configuration file is /etc/crontab, but depending on the Linux distribution there may be another file where you can add tasks. The crontab file is read every minute by the cron process to see if there is any work to be done. The amount of daily manual work to do your backup can reduce considerably if you have access to the crontab file and can add your own commands to it.

buildersweb

10:02 am on Jul 28, 2010 (gmt 0)

10+ Year Member



Thanks for the advise .. I will ask the hosting company if i can add a process to crontab.

I will post again

buildersweb

12:21 pm on Jul 28, 2010 (gmt 0)

10+ Year Member



I got this for an answer ..
"You need to write a compression script (or a compression command) yourself.
You need to do that because our services and expertise do not include writing scripts."

I have to admit that neither do i ..

How can i write that script ? Thanks

buildersweb

10:23 am on Jul 30, 2010 (gmt 0)

10+ Year Member



Any help?

phranque

11:14 pm on Jul 30, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the script would be written using bash shell commands that invoke the archive and compression utilities.
i would suggest creating .tgz files which combine tar archive format and gzip compression.

caribguy

12:22 am on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've had good experiences with rsync. It's available for Linux and Windows. You can run it in combination with SSH to create a secure connection to your backup machine.

Set up SSH and rsync as a service on your windows box, and run a shell script daily from your crontab.

A quick search brought up a bunch of step by step tutorials.

buildersweb

1:22 pm on Aug 3, 2010 (gmt 0)

10+ Year Member



Can you sent me a link about rsync in windows (local pc) to download and to read ?

As i can imagine i will set this up to my local pc and it will take back up only the changed files .

Why shall i run a daily script from crontab? i got confused ...

caribguy

12:26 am on Aug 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm planning to implement this for our server in the future, but haven't quite gotten that far yet. We currently use it to keep a week's worth of incremental backups from the file server on an external USB drive.

Start by googling 'offsite rsync backup to windows' - the results include a lot of tutorials to do just the the reverse, i.e. from windows to linux - but the procedure is very similar.

Your windows machine will become the server, so it's important that ssh and rsync services will be running when the client (your linux machine) attempts to connect. You can schedule the connections to take place at a predefined time each day by running a backup script via the crontab.

The idea is that your rsync daemon only accepts connections from localhost, and that ssh is used to tunnel outside requests to the daemon (port 873). I have used FreeSSHD to tunnel to my VNC on my office machine when travelling, so I suppose that this could work for rsync as well. Various tools are included with the cwRsync installer, check those out as well.

Every night, the script on your linux machine starts the rsync client and establishes a ssh connection to your windows box. Read the various tutorials on how to configure your backups. The exact steps will depend on your specific needs.

buildersweb

9:23 am on Aug 24, 2010 (gmt 0)

10+ Year Member



Can i have a little help with bash shell commands?

What lines shall i add to the crontab file so that it will zip the folders at specified time?

buildersweb

9:53 am on Aug 24, 2010 (gmt 0)

10+ Year Member



i also try to execute that
$ tar -zxvf Backup/cpbackup/daily daily.tar.gz

But i get
-bash: $: command not found

Any suggestions?

phranque

10:33 am on Aug 24, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the "$" is a command line prompt, so leave that out of your command.
just use this:
tar -zxvf Backup/cpbackup/daily daily.tar.gz

this thread should be helpful...
How to set up specific time for cron job?:
http://www.webmasterworld.com/linux/3402276.htm [webmasterworld.com]

caribguy

5:03 pm on Aug 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you first make a tarball out of your directory, you'll end up making a full backup every day. Is that what you want?

If not: rsync has a -z flag that tells it to compress the files in transit. Be sure not to double-compress, by turning it off in ssh. Put "Compression=no" in your ssh command.