#!/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");