LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Cron: TERM environment variable not set. (http://www.linuxquestions.org/questions/linux-general-1/cron-term-environment-variable-not-set-170674/)

hydro 04-15-2004 05:15 PM

Cron: TERM environment variable not set.
 
I have a cron job set as:

/home/paul/mysqlbackup.sh > /dev/null

Even though its going to null i still get a message stating
"TERM environment variable not set."


here is the script:

Code:

#####################################
### MySQL Configuration Variables ###
#####################################

# MySQL Hostname
DBHOST='lxxx'

# MySQL Username
DBUSER='xxx'

# MySQL Password
DBPASSWD='xxx'
 
#####################################
### FTP Configuration Variables #####
#####################################

# FTP Hostname
FTPHOST='xxx'

# FTP Username
FTPUSER='xxx'

# FTP Password
FTPPASSWD='xxx'

# Local Directory for Dump Files
LOCALDIR=/home/paul/mysqlbackup/

# Remote Directory for Offsite Backup
REMOTEDIR=/home/backup/

# Prefix for offsite .tar file backup
TARPREFIX=db1

#####################################
### Edit Below If Necessary #########
#####################################
clear
echo MySQL Backup Script v1.0
echo ---------------------------
echo .
cd $LOCALDIR
SUFFIX=`eval date +%y%m%d`

#DBS=`mysql -u$DBUSER -p$DBPASSWD -e"show databases"`
DBS=`/usr/local/bin/mysql -u$DBUSER -p$DBPASSWD -e"show databases"`
echo Archiving...
for DATABASE in $DBS
do
        if [ $DATABASE != "Database" ]; then
                FILENAME=$SUFFIX-$DATABASE.gz
                echo Database: $DATABASE
                /usr/local/bin/mysqldump -u$DBUSER -p$DBPASSWD $DATABASE | gzip --best > $LOCALDIR$FILENAME
        fi
done

echo Archiving Complete
echo .
chmod 400 $LOCALDIR*.gz

tar -cf $TARPREFIX-$SUFFIX.tar $SUFFIX-*.gz

echo Connecting to $FTPHOST

ftp -n $FTPHOST <<END_SCRIPT
quote USER $FTPUSER
quote PASS $FTPPASSWD
passive

and a bit more after

because of the message, the cron results are emailed to me, but I dont want it hehe.

What am I supposed to do. i know i need to set some TERM terminal, but to what and where.

Tinkster 04-15-2004 05:38 PM

Quote:

/home/paul/mysqlbackup.sh > /dev/null
Try
home/paul/mysqlbackup.sh > /dev/null 2>&1



Cheers,
Tink

hydro 04-15-2004 10:00 PM

Thank you, hopefully this will do it

Tinkster 04-15-2004 10:03 PM

Well, it won't set the variable, but you won't get the error ;)


Cheers,
Tink

mgatny 04-15-2004 10:59 PM

Quote:

i know i need to set some TERM terminal, but to what and where.
The script does not have a terminal because you are running it from cron -- so it's ok to ignore the warning as the previous post suggests.


All times are GMT -5. The time now is 09:03 PM.