#!/usr/bin/perl use warnings; use strict; my $day=`date "+%Y%m%d"`; chomp $day; # directories in $HOME I want to archive only my @taronly=('releases', 'tajne'); # directories in $HOME I want to archive and compress my @targzip=('perl', 'szkola', 'projects', 'sync', 'grafika', 'public_ +html', 'ethernet', 'svn'); chdir; die if system("mkdir backup-$day"); foreach (@taronly) { print "Archiving $_...\n"; die if system("tar cf backup-$day/$_-$day.tar $_"); } foreach (@targzip) { print "Archiving and compressing $_...\n"; die if system("tar czf backup-$day/$_-$day.tar.gz $_"); } chdir "backup-$day"; print "Computing md5 checksums...\n"; die if system("md5sum * > sums.md5");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Just another backup script
by Tanktalus (Canon) on Aug 30, 2009 at 22:47 UTC | |
by sundance_kid (Sexton) on Sep 01, 2009 at 08:34 UTC | |
by chomzee (Beadle) on Sep 07, 2009 at 20:58 UTC | |
|
Re: Just another backup script
by DrHyde (Prior) on Sep 03, 2009 at 09:19 UTC |