initial commit of file from CVS for smeserver-userpanels on Sat Sep 7 21:13:20 AEST 2024
This commit is contained in:
19
root/etc/e-smith/events/actions/calc-du
Normal file
19
root/etc/e-smith/events/actions/calc-du
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/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);
|
Reference in New Issue
Block a user