That's nothing special or impressive, but I use this script to make backup of my private files. It creates ~/backup-$DATE directory, puts there archived stuff and computes md5 sums. I hope somebody will find it useful.
#!/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");
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.