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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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. |
| |||
| 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". |
| |||
| 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... |
| |||
| 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 |
| |||
| 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. |
| |||
| 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 ** ************************************************** ****************** |
| ||||
| 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 |