Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...with companys cutting back on training, lack of true support by makers of software, the forums are a great tool in your cyber-toolbox...."

Geography

Where in the world do Tek-Tips members come from?

FTP on cron: how to be silent except errorsHelpful Member! 

OsakaWebbie (Programmer)
9 Apr 12 22:06
I made a cron script to do some backups and FTP them offsite.  Everything is running fine, but I still get an email with "Interactive mode off."  Here is the relevent part of my script:

CODE

ftp -n $REMOTESERVER <<INPUT_END
quote user $LOGIN
quote pass $PASSWORD
prompt off
put myfile1.tar.gz
put myfile1.tar.gz
exit
INPUT_END
I don't want to send the whole output to /dev/null or something, because I want to be notified if there are errors.  But I also don't want this useless email every night.  I tried just doing "prompt off > /dev/null", but it didn't shut it up.  Suggestions?
Helpful Member!  IPGuru (TechnicalUser)
10 Apr 12 4:15
you could try just rerouteing stdout

ftp -n $REMOTESERVER 1>/dev/nul <<INPUT_END

if it is stderr you need to reroute then use 2> instead.
 

A Maintenance contract is essential, not a Luxury.
Do things on the cheap & it will cost you dear

OsakaWebbie (Programmer)
10 Apr 12 21:10
Thanks!  I was forgetting that STDOUT and STDERR are separate, and I didn't realize that I needed to do the redirect for the whole ftp command, not the commands inside that (which are not commands to the shell but to ftp).

Aside: For the sake of future readers, the spelling seems to be null, not nul, and the 1 is technically optional (STDOUT is the default).

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close