Quote:
Originally Posted by go0ogl3
I've managed to improve this script a little, so here is a new version.
|
Sorry go0ogl3, after your making available the improved script, I couldn't get enough time to check it. Today, I checked and as expected it works like a charm. Thanks for the great work done.
Moreover, I came to know one point that the error
Code:
line 238(or 273): [: -gt: unary operator expected
might be due to wrong information store in
Code:
COMPUTER=`cat /etc/HOSTNAME | awk 'NR==1{print $1}'`
variable. As I have been using ubuntu, my hostname store in /etc/hostname (not /etc/HOSTNAME). If $COMPUTER variable has wrong data or empty, then $BACKUPDIR will point wrong, recursively
pfs=`df -h $BACKUPDIR | awk 'NR==2{print $5}' | cut -d% -f 1` shall also have wrong data, giving error on line 238 (or 273).
Those who get such error, check
COMPUTER=`cat /etc/HOSTNAME | awk 'NR==1{print $1}'` line and alter according to your distro.
Thanks once again go0ogl3, this is exactly what I wanted for backup solution.
Dipesh