Created
May 23, 2013 08:57
-
-
Save keedi/5633654 to your computer and use it in GitHub Desktop.
백업 :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.010; | |
use strict; | |
use warnings; | |
use Time::Piece; | |
my @excludes = qw( | |
/data | |
/lost+found | |
/media | |
/mnt | |
/proc | |
/run | |
/sys | |
/tmp | |
/var/cache | |
); | |
chomp( my $id = `lsb_release -is` ); | |
chomp( my $codename = `lsb_release -cs` ); | |
my $dt = localtime; | |
my $tarball = sprintf( "/data/dump-rootfs/dump-$id-$codename-%s.tar.gz", $dt->datetime ); | |
system( | |
'tar', | |
'cvzf', | |
$tarball, | |
map( "--exclude=$_", @excludes ), | |
'/', | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment