LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-05-2013, 02:25 PM   #1
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Rep: Reputation: Disabled
ftp and cron


Hey guys and gals!!

I have a crontask set to run every night at 2:00AM. I put the string "MAILTO="someone@aplace.com"

The email tells me that a cron task ran at 2:00AM. This cron task is to FTP some files from a remore server. I'm using lftp, and that works like a champ. What I'm looking for from the email is the output of the command, ie: what files were transferred, if any.

Much appreciate any help offered.
 
Old 12-05-2013, 02:44 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
You can set the option:
Code:
set xfer:log 1
to make lftp write the file transferred in ~/.lftp/transfer_log. Then you can simply send the file as attachment using mutt or uuencode. If you want the content of the file to be inserted in the mail sent by the cron job, just put
Code:
cat $HOME/.lftp/transfer_log
at the end of your script and it will be sent together with the standard output and the standard error of your script. Hope this helps.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
In plesk , I wish to have a backup cron job, ftp back up file to another ftp server? muskiediver Linux - General 6 07-16-2009 03:13 AM
Cron FTP get and delete dreammold Linux - Newbie 6 12-31-2007 11:39 AM
FTP Cron JOB skb2005 Linux - Server 6 09-04-2007 09:40 AM
ftp via cron madhavr Linux - Server 3 06-17-2007 04:34 AM
cron+script+FTP tommytomato Linux - General 6 01-13-2006 11:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration