View Single Post
Old 9th May 2010, 11:45
dipeshmehta dipeshmehta is offline
Senior Member
Join Date: Nov 2008
Location: Rajkot, India
Posts: 175
Thanks: 5
Thanked 13 Times in 13 Posts
Send a message via Yahoo to dipeshmehta Send a message via Skype™ to dipeshmehta

Originally Posted by go0ogl3 View Post
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
line 238(or 273): [: -gt: unary operator expected
might be due to wrong information store in
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.

Reply With Quote