20 lines
573 B
Plaintext
20 lines
573 B
Plaintext
|
#!/usr/bin/perl -w
|
||
|
|
||
|
#----------------------------------------------------------------------
|
||
|
# Author Stephen Noble <stephen@dungog.net>
|
||
|
# create backup scripts for dungog-USERbackup
|
||
|
#----------------------------------------------------------------------
|
||
|
|
||
|
my $event = $ARGV [0];
|
||
|
my $userName = $ARGV [1];
|
||
|
|
||
|
die "Username argument missing." unless defined ($userName);
|
||
|
|
||
|
my $path = "/home/e-smith/files/users/$userName";
|
||
|
|
||
|
#recreate current disk free
|
||
|
system("/usr/bin/du -sh $path > /tmp/du-$userName") == 0
|
||
|
or die ("Error occurred creating /tmp/du.\n");
|
||
|
|
||
|
exit (0);
|