View Single Post
Old 6th March 2010, 22:21
go0ogl3 go0ogl3 is offline
Join Date: Jul 2008
Posts: 73
Thanks: 5
Thanked 39 Times in 6 Posts

Originally Posted by dipeshmehta View Post
Hello all,

I get
line 238: [: -gt: unary operator expected
whre the code is
function check_space {
    #pfs=$(($pfs-1)) # for test
    pfs=`df -h $BACKUPDIR | awk 'NR==2{print $5}' | cut -d% -f 1`

    if [ $pfs -gt $maxp ] ;then
	log "There is $pfs% space used on $BACKUPDIR"
	    if [ $del_en = "yes" ] ; then
line 292: -cjpSPf: command not found
where the code is
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."
I have been using Ubuntu 8.04 Server.

Please help me to get rid of the situation.

Thanks in advance.

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.
Reply With Quote