- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sftp cron job not working
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2009 05:19 PM
тАО04-05-2009 05:19 PM
sftp cron job not working
I'm trying to atoumate aa sftp file transfer to run as a cron job. If I run it interactively, it works fine.
sftp -b /home/rocky.coned.sftp rocky@sftp.remoteserver.com
coned.sftp looks like this:
put /home/rocky/coned.csv
quit
No error in cron log. Trying to run it as user rocky. Set up job using crontabs -e
Thanks,
Rocky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2009 06:56 PM
тАО04-05-2009 06:56 PM
Re: sftp cron job not working
You probably need an absolute path for sftp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2009 08:16 PM
тАО04-05-2009 08:16 PM
Re: sftp cron job not working
I tried it with absolute path and still not working. No message in mail.
Thanks,
Rocky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2009 08:22 PM
тАО04-05-2009 08:22 PM
Re: sftp cron job not working
for sftp the first command you have to give absolute path like /usr/bin/sftp
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2009 08:28 PM
тАО04-05-2009 08:28 PM
Re: sftp cron job not working
Typo in first post
/usr/bin/sftp -b /home/rocky/coned.sftp rocky@sftp.remoteserver.com
coned.sftp looks like this:
put /home/rocky/coned.csv
quit
Thanks,
Rocky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2009 11:29 PM
тАО04-06-2009 11:29 PM
Re: sftp cron job not working
try
/usr/bin/sftp -b /home/rocky/coned.sftp rocky@sftp.remoteserver.com 1>tmp/sftp.log 2>&1
and post the content of /tmp/sftp.log
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2009 11:51 PM
тАО04-06-2009 11:51 PM
Re: sftp cron job not working
scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 12:08 AM
тАО04-07-2009 12:08 AM
Re: sftp cron job not working
J.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 12:46 AM
тАО04-07-2009 12:46 AM
Re: sftp cron job not working
It suppose to work if you have configured password less login between source and remote server for rocky user.
We have similiar kind of setup and it is working. Try like this...
#vi /home/rocky/putjob
sftp rocky@sftp.remoteserver.com <<**
lcd /home/rocky
put coned.csv
**
:wq!
put the file putjob on crontab something like this..
30 * * * * /home/rocky/putjob >> /home/rocky/putjob.log 2>&1
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 03:54 AM
тАО04-07-2009 03:54 AM
Re: sftp cron job not working
Have your tried just using 'scp' instead?
Regards,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 04:46 AM
тАО04-07-2009 04:46 AM
Re: sftp cron job not working
scp is a better tool for this job. Rita hits the nail on the head.
scp -p /home/rocky.coned.sftp rocky@sftp.remoteserver.com:///home/rocky/coned.csv
Before trying either, use this document to set up password free access properly.
http://www.hpux.ws/?p=10
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 07:09 AM
тАО04-07-2009 07:09 AM
Re: sftp cron job not working
Thanks for the replies.
I solved the issue. I was trying to execute the command in the "rocky" crontab file. I put the command in a file name coned.cron and gave it a chmod 700. I put the coned.cron file in the "rocky" crontab and it worked. I think it didn't like the space in the command.
Thanks for your help.
Rocky