You are not logged in.

#1 2005-02-26 18:57:24

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Automated (incremental) backups of important files. How?

I'm looking for a script or nice program that allows me to run it automagically through cron and that incrementally backs up the files/directories I select. It should put the new files in a compressed archive and then transfer to my server.

Does anyone have a script or simple program for that? I've been looking at Bacula but it seems waaaaay to powerful for the simple things I want.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#2 2005-02-26 21:11:07

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,017

Re: Automated (incremental) backups of important files. How?

Maybe hdup is what you're looking for. It's in arch's extra repo.

Offline

#3 2005-02-27 22:17:37

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Automated (incremental) backups of important files. How?

Looks very neat! I'm going to try it out as soon as I can. Thanks a lot! smile


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#4 2005-02-28 04:44:19

skoal
Member
From: Frequent Flyer Underworld
Registered: 2004-03-23
Posts: 612
Website

Re: Automated (incremental) backups of important files. How?

#!/bin/bash
# ==> Script by James R. Van Zandt
HERE=`uname -n`    # ==> hostname
THERE=bilbo
echo "starting remote backup to $THERE at `date +%r`"
# ==> `date +%r` returns time in 12-hour format, i.e. "08:08:34 PM".
  
# make sure /pipe really is a pipe and not a plain file
rm -rf /pipe
mkfifo /pipe       # ==> Create a "named pipe", named "/pipe".
  
# ==> 'su xyz' runs commands as user "xyz".
# ==> 'ssh' invokes secure shell (remote login client).
su xyz -c "ssh $THERE "cat >/home/xyz/backup/${HERE}-daily.tar.gz" < /pipe"&
cd /
tar -czf - bin boot dev etc home info lib man root sbin share usr var >/pipe
# ==> Uses named pipe, /pipe, to communicate between processes:
# ==> 'tar/gzip' writes to /pipe and 'ssh' reads from /pipe.

# ==> The end result is this backs up the main directories, from / on down.
exit 0

Slap that puppy in cron and see what happens.  I haven't tried it out yet myself, but it seems like it might suit your specific needs.  You might want to change the location of "/pipe" to a path not parsed in your backup directories, and just edit the directories on the "tar" line you want backed up.

Name that file "backup.sh" and give it executable permissions.  Put it in your PATH, and then add a script to call it in `/etc/cron.[hourly|daily|monthly]`, or just put the script in there itself.

Offline

Board footer

Powered by FluxBB