Unix Technical Forum

recommendation for a backup script

This is a discussion on recommendation for a backup script within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Hi! I'm looking for recommendations for making a backup shell script. I already have a script that makes backup ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 09:00 AM
Mr.Jason
 
Posts: n/a
Default recommendation for a backup script

Hi!
I'm looking for recommendations for making a backup shell script.
I already have a script that makes backup of user files, tars them and sends
them to my own home folder (so I can download them) I would like to improve
this script, however.

tar -cvvf /home/stuff.tar /home

What kind of script I sould write to another linux maching so that it would
peridiocally download certain file via FTP from my server?

Sorry, these are so basic stuff.

-----
Check out the New Album
http://cutout.ath.cx
Listen my music at
http://www.rocketradio.com/mrjason
Get my previous CD East End
http://www.cdbaby.com/mrjason


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 09:00 AM
Grant Coady
 
Posts: n/a
Default Re: recommendation for a backup script

On Thu, 2 Jun 2005 11:06:07 +0300, "Mr.Jason"
<jaakkochanREMOVETHIS@surfeu.fi> wrote:

> What kind of script I sould write to another linux maching so that it would
> peridiocally download certain file via FTP from my server?


FTP is an old protocol with plaintext username/password. Take the
time to learn rsync, a cron triggered rsync is best way, also
(can't find reference) there's a reference out there for time
based rsync backups exploiting unix hardlinked filesystem, learn
rsync first.

Take care with --delete option, don't use it until you sure rsync
working as expected.

Here's one that copies a subset of slackware install files to firewall:

grant@deltree:/home/local$ cat rsync-slack
#!/bin/sh
rsync -avP --delete --delete-excluded \
--exclude extra \
--exclude pasture \
--exclude source \
--exclude testing \
--exclude zipslack \
--exclude slackware/d \
--exclude slackware/e \
--exclude slackware/f \
--exclude slackware/gnome \
--exclude slackware/k \
--exclude slackware/kde \
--exclude slackware/kdei \
--exclude slackware/t \
--exclude slackware/tcl \
--exclude slackware/x \
--exclude slackware/xap \
peetoo.mire.mine.nu::slackware-10.1/ \
/home/local/slack-10.1

peetoo is fileserver box, but it could be a machine anywhere on
the 'net. Scripts I use to rsync external stuff similar syntax.

from man rsync:
Some of the additional features of rsync are:

o support for copying links, devices, owners, groups, and
permissions

o exclude and exclude-from options similar to GNU tar

o a CVS exclude mode for ignoring the same files that CVS
would ignore

o can use any transparent remote shell, including ssh or rsh

o does not require root privileges

o pipelining of file transfers to minimize latency costs

o support for anonymous or authenticated rsync servers
(ideal for mirrorĀ*
ing)


On the server you need to describe rsync sources in a manner similar
to samba, rsync written by samba author.

grant@peetoo:/home/public$ cat /etc/rsyncd.conf
# /etc/rsyncd.conf for slackware-10.1 on peetoo

uid = nobody
gid = nobody
use chroot = no
max connections = 4
syslog facility = local5
pid file = /var/run/rsyncd.pid

[install]
path = /home/install
comment = peetoo install area (ro)
read only = yes

[slackware-10.1]
path = /home/install/slackware-10.1
comment = install slackware-10.1 (ro)
read only = yes

[slackware-current]
path = /home/install/slackware-current
comment = slackware-current (ro)
read only = yes

[public]
path = /home/public
comment = peetoo public area (ro)
read only = yes

Of course my firewall prevents external access to rsync server.
Notice the read-only? Protect yourself against finger trouble
while learning

Apologies for word-wrapping or strangeness, trying the other news
server, settings on UA not quite right yet.

--Grant.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 09:01 AM
dvjkwck02@sneakemail.com
 
Posts: n/a
Default Re: recommendation for a backup script

That's the worst solution for backups I have ever seen. You have no way
to verify the data you are storing. You have no way to restore data if
the backup was foobar. Why not use your head instead of your ass to
think with before recommending something like a cron job and rsync for
a backup solution.

man tar

Look for --newer (-N)

Store backup archives somewhere safe, not on a hard drive.

That's not even the best solution, but it's a lot better then hoping
rsync will somehow magically know that the data it is writing is "good".

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 09:01 AM
Grant Coady
 
Posts: n/a
Default Re: recommendation for a backup script

On 2 Jun 2005 18:35:16 -0700, dvjkwck02@sneakemail.com wrote:
>
> That's not even the best solution, but it's a lot better then hoping
> rsync will somehow magically know that the data it is writing is "good".


some lusers will never realise unix toolbox philosophy...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 09:02 AM
Daniel de Kok
 
Posts: n/a
Default Re: recommendation for a backup script

On Thu, 02 Jun 2005 18:35:16 -0700, dvjkwck02 wrote:
> That's the worst solution for backups I have ever seen.


No, it is not.

> You have no way to verify the data you are storing.


rsync verifies the checksums of the backup with those of the original.
Besides that it copies cheap, because if a file differs, checksums of file
chunks are compared, and rsync will only resynchronise the chunks that
were changed.

> You have no way to restore data if the backup was foobar.


Why not? You will have an exact copy.

For the OP: this is a nice article that explains how you could make
backups with rsync:

http://www.mikerubel.org/computers/rsync_snapshots/

-- Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 09:02 AM
Grant Coady
 
Posts: n/a
Default Re: recommendation for a backup script

On Fri, 03 Jun 2005 16:40:04 +0200, Daniel de Kok <daniel@mindbender.nowhere> wrote:
> Why not? You will have an exact copy.
>
> For the OP: this is a nice article that explains how you could make
> backups with rsync:
>
> http://www.mikerubel.org/computers/rsync_snapshots/
>

Also search sf.net (sourceforge) for 'rsync' --> numbers of projects
and scripts use rsync for time-based backup + hardlink = reduced
incremental backup time and versioned backups. Snoop network and
grab datafiles when they change.

Slightly related: I use 'cp -al src.a src.b' duplicate kernel source
tree for cost of new directory structure --> copy ~200MB for ~250KB
space. Something of that order ... I'm sleepwlaking/not going to turn
on linux box to measure

--Grant.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-20-2008, 09:03 AM
Eef Hartman
 
Posts: n/a
Default Re: recommendation for a backup script

Daniel de Kok <daniel@mindbender.nowhere> wrote:
> rsync verifies the checksums of the backup with those of the original.


Only if you use the "-c" option, otherwise it only compares date/time/size
(which is MUCH faster!).
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-20-2008, 09:03 AM
Daniel de Kok
 
Posts: n/a
Default Re: recommendation for a backup script

On Sat, 04 Jun 2005 14:55:20 +0200, Eef Hartman wrote:
> Daniel de Kok <daniel@mindbender.nowhere> wrote:
>> rsync verifies the checksums of the backup with those of the original.

>
> Only if you use the "-c" option, otherwise it only compares date/time/size
> (which is MUCH faster!).


Yes, that is right. Sorry for the oversight.

-- Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com