LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-15-2004, 05:15 PM   #1
hydro
Member
 
Registered: Feb 2003
Distribution: Slackware 9.0
Posts: 82

Rep: Reputation: 15
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.
 
Old 04-15-2004, 05:38 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Quote:
/home/paul/mysqlbackup.sh > /dev/null
Try
home/paul/mysqlbackup.sh > /dev/null 2>&1



Cheers,
Tink
 
Old 04-15-2004, 10:00 PM   #3
hydro
Member
 
Registered: Feb 2003
Distribution: Slackware 9.0
Posts: 82

Original Poster
Rep: Reputation: 15
Thank you, hopefully this will do it
 
Old 04-15-2004, 10:03 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Well, it won't set the variable, but you won't get the error ;)


Cheers,
Tink
 
Old 04-15-2004, 10:59 PM   #5
mgatny
Member
 
Registered: Mar 2004
Location: Ann Arbor, MI
Distribution: Debian, SuSE
Posts: 41

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scp error, TERM env. variable not set? jimbo Linux - Networking 2 11-26-2005 01:31 AM
How to set a value of environment variable? ukrainet Linux - Newbie 1 12-28-2004 04:33 AM
set environment variable Jongi Linux - Newbie 7 03-01-2004 04:34 AM
how to set CC environment variable mr.moto General 2 12-18-2001 01:02 AM
how do you set the environment variable CC? mr.moto Linux - General 0 12-17-2001 09:17 PM


All times are GMT -5. The time now is 03:54 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration