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

Quote:
Originally Posted by dipeshmehta View Post
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.
Reply With Quote