FTP Cron issues


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP Cron issues
# 1  
Old 06-01-2006
FTP Cron issues

I am on AS3 Update 4 Linux
and am having an issue with an automated ftp script, I tried using the fd/sub proc method and that did not seem to work either. I normally use the following method to perform my ftp's but for some reason it works if I launch the script at the command line but in Cron it fails. Any help or suggestions would be appreciated.


<Begin Code>
#!/bin/bash
some othe code

echo "open IP ADDR" > $HOME/.ftpcpu
echo "user <user> <password>" >> $HOME/.ftpcpu
echo "binary" >> $HOME/.ftpcpu
echo " cd <Directory>" >> $HOME/.ftpcpu
echo "put $filename" >> $HOME/.ftpcpu
/usr/bin/ftp -n < $HOME/.ftpcpu
rm $HOME/.ftpcpu
<End Code>

The only thing diffrent on this system than the others that are in production is this ftp does not have a batch mode (-b) option.
# 2  
Old 06-01-2006
Question #1 - is $HOME defined? The mian reason cron scripts fail is that they don't normally source /etc/profile and often do not have environment variables you have otherwise.
# 3  
Old 06-02-2006
Yes $HOME is defined, The error is with ftp wanting me to input username and Password. I turned writing stdout and stderr to dev/null off so I could see the error.

I do not get this error when I execute the script at command line
# 4  
Old 06-02-2006
u can use .rlogin concept

On the destination Server ,
if u make entry in the .rlogin file for corresponding Source Ipaddress and username .

<Source IP address> <Username>

when u do ftp from
<Source IP address> using <Username>
It will not ask password .
u can execute ur batch ftp programs .

Normally in Windows it can be done by ftp -s:file
we can write username,passwd in file and execute the batch ftps.
but whereas in Unix .rlogin concept is used.
# 5  
Old 06-05-2006
Make Entry in .rhosts

In previous post ,I have written that make entry in .rlogin ,it is .rhosts file.
If U make entry in .rhosts file with IP address and username.
Remote Commands are allowed from <IPADDRESS> for <Usename> without passwords
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Db2 command issues with cron

Hi, I have a very simple script that queries from a DB2 table. The script has 3 parts - (i) Sets the db2profile (ii) connects to db2 using credentials (iii) executes the query.This script works fine if i run it manually from the command prompt. However when scheduled in crontab, it proceeds... (2 Replies)
Discussion started by: VeePee
2 Replies

2. Shell Programming and Scripting

Bash/cron issues

Hi all, I am trying to run a cronjob to push my files to my git repo once a week and output a prompt to a logfile, my script works fine if I invoke it manually but my cronjob wont run for some reason, I have sourced the file, and restarted my Mac to no avail, right now I believe I have the cronjob... (8 Replies)
Discussion started by: gmenfan83
8 Replies

3. UNIX for Advanced & Expert Users

Cron security issues?

Does the use of cron (HP-UX 11) present a security risk IF it is only given to accounts which have shell access anyway. If it does present a risk, what is the risk? Can a script (or command) run via cron; run anything, write anywhere or read anywhere that the same user can not do outside of... (2 Replies)
Discussion started by: eileenkeeney
2 Replies

4. Solaris

cron / crontab issues - solaris 10

I am having some issues with my cronjobs not running in solaris 10. Cron is running: ~> ps -ef | grep cron root 202 1 0 Jul 18 ? 0:01 /usr/sbin/cron bender 1646 1562 0 01:57:49 syscon 0:00 grep cron crontab -l lists the cronjob and I *think* its in the... (8 Replies)
Discussion started by: ippy98
8 Replies

5. UNIX for Dummies Questions & Answers

Permissions Issues FTP server

Hi all, Quick question, im going to find this a bit hard to explain but ill give it a go. Basically i have an admin account on an FTP server that i want to be able to control ALL files without having to use sudo (as i need to run cron scripts to move files that are owned by a number of... (2 Replies)
Discussion started by: mokachoka
2 Replies

6. UNIX for Advanced & Expert Users

FTP issues between mainframe and UNIX

Hi All, The issue is that, we have a dataset in mianframe whose record length is 153 characters. And a batch job ftpies it to the unix server(SunOS) as a test file. But the ftpied file in unix does not have a record length of 153 chars. Each record of 153 chars gets splited into two line of... (8 Replies)
Discussion started by: hareeshkumaru
8 Replies

7. UNIX for Advanced & Expert Users

Cron FTP job

We have a script that we run manually, we want to set it up so that it will run automatically via cron, the problem is during the ftp process nothing is put, the script logs in changes directory fine, but nothing is put to the directory. I have tried it as root, a power user, etc. I have made the... (4 Replies)
Discussion started by: marvin51796
4 Replies

8. Shell Programming and Scripting

FTP Cron Issue

I have an automated FTP script that is giving me grief. The script runs a ftp sweep for one of our accounts. It gets about 90 files then hangs. When i run ftp manually from cli everything runs great and I pickup the thousands of files waiting. I used to run lftp, but it has been behaving even... (7 Replies)
Discussion started by: edua
7 Replies

9. UNIX for Dummies Questions & Answers

cron ftp job help

I am new to cron and am trying to set a cron job that will run everyday at 2 to go out to a server (via ftp with user name and password) and get a file and then bring it back to my sever. Below is what I have but it doesn't seem to be working. Any help would be appreciated. cron command - will... (4 Replies)
Discussion started by: bernfuss
4 Replies
Login or Register to Ask a Question