Skip to content

Instantly share code, notes, and snippets.

@keedi
Created May 23, 2013 08:57
Show Gist options
  • Save keedi/5633654 to your computer and use it in GitHub Desktop.
Save keedi/5633654 to your computer and use it in GitHub Desktop.
백업 :-)
#!/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