Quote:
Originally Posted by dipeshmehta
Hello all,
I get
Code:
line 238: [: -gt: unary operator expected
whre the code is
Code:
function check_space {
#pfs=$(($pfs-1)) # for test
pfs=`df -h $BACKUPDIR | awk 'NR==2{print $5}' | cut -d% -f 1`
#pfs="90"
if [ $pfs -gt $maxp ] ;then
log "There is $pfs% space used on $BACKUPDIR"
if [ $del_en = "yes" ] ; then
and
Code:
line 292: -cjpSPf: command not found
where the code is
Code:
if [ -z $fb ] ; then
log "No full backup found for $YX. Full backup now!"
echo > $tmpdir/full-backup$XX.lck
$TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded
log "Backup of $YX done."
fi
I have been using Ubuntu 8.04 Server.
Please help me to get rid of the situation.
Thanks in advance.
Dipesh
|
Hello, the first error is because the space check fails, one of the $pfs or $maxp parameters is not a number. This is a non fatal error so you can ignore it. Maybe will be corected in a future version of the script, or you can adapt the function to check the free space corectly for your situation...
The second error occurs only if you don't have "tar" installed on your linux, or you don't have "which" command or the "tar" is not in your PATH and is given because the $TAR on the 292 line is NULL. "TAR" is defined in the header of the script by default with TAR=`which tar` on line 111.
So to get rid of the situation you must check the free space problem if you care about that and most important, you must resolve the "tar" problem. If "tar" isn't in your PATH please define the "TAR=" with the path to the tar binary.
For more problems, ask here, I'll try to respond ASAP.
Recent comments
1 day 21 hours ago
2 days 6 hours ago
2 days 9 hours ago
2 days 10 hours ago
2 days 11 hours ago
2 days 13 hours ago
2 days 14 hours ago
2 days 16 hours ago
3 days 7 hours ago
3 days 8 hours ago