Operating System - HP-UX
1753667 Members
5525 Online
108799 Solutions
New Discussion юеВ

Ftp script unable to pull the file with cronjob

 
pv_2
Advisor

Ftp script unable to pull the file with cronjob

When i ran manually it's picking up the file. With cron Job it saying: -

Retrieving:
System: Ftpsite.com
Directory: /outbound
Mode: binary
File(s): xxx.csv.pgp

autoftp.pl: successful completion of retrieving files
gpg: WARNING: unsafe ownership on homedir "/usr/local/etc/gpg"
gpg: cannot open `/dev/tty': No such device or address
/usr/local/tools/bin/mv: cannot stat `xxx.csv': No such file or directory


**********************************************

When I Run Maually with same userID:

Retrieving:
System: FTPSite Address
Directory: /outbound
Mode: binary
File(s): XXX.csv.pgp

autoftp.pl: successful completion of retrieving files
gpg: WARNING: unsafe ownership on homedir "/usr/local/etc/gpg"
gpg: public key is 3295242B
gpg: public key is F42E1C6C
gpg: using secondary key F42E1C6C instead of primary key AFBD9DF5
gpg: using secondary key F42E1C6C instead of primary key AFBD9DF5
gpg: CAST5 encrypted data
gpg: original file name='XXX.csv'
gpg: WARNING: message was not integrity protected `XXX.csv' -> file path/XXX.csv'
9 REPLIES 9
Patrick Wallek
Honored Contributor

Re: Ftp script unable to pull the file with cronjob

gpg expects to be able to interact with the terminal by default. If it can't it errors out.

You need to add the '--notty' switch to your gpg command line in your script.
OldSchool
Honored Contributor

Re: Ftp script unable to pull the file with cronjob

do you suppose the actual commands / script used in cron might have been helpful?

as well as the actual crontab entry?
the messages produced from the command line (if any)?
James R. Ferguson
Acclaimed Contributor

Re: Ftp script unable to pull the file with cronjob

HI:

What operating system and software are you using? The 'autoftp.pl' notation suggests a Perl script.

The message "gpg: cannot open `/dev/tty': No such device or address" is consistent with a crontask which is _not_ associated with a terminal when it runs.

Remember that a 'cron' task runs in a very minimal environemnt. Your PATH, for example, is limited to '/usr/bin:/usr/sbin:.'

Regards!

...JRF...
pv_2
Advisor

Re: Ftp script unable to pull the file with cronjob

Hi ,

Iam using HP-UX 11.11. I am new to scripting. This one some body else wrote. It was working fine before. suddenly we are getting error as unsafe owership. please help me out

Padmaja
James R. Ferguson
Acclaimed Contributor

Re: Ftp script unable to pull the file with cronjob

Hi (again):

> suddenly we are getting error as unsafe owership. please help me out

Google suggests that you try something like this:

http://lists.gnupg.org/pipermail/gnupg-users/2008-May/033596.html

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Ftp script unable to pull the file with cronjob

Hi:

...and:

http://lists.gnupg.org/pipermail/gnupg-users/2003-October/020342.html

Similar results can be found using the Google search string "gpg warning unsafe ownership homedir" --- nice, huh?

Regards!

...JRF...
pv_2
Advisor

Re: Ftp script unable to pull the file with cronjob

I changed the permissions now 700. Before it was 777.
James R. Ferguson
Acclaimed Contributor

Re: Ftp script unable to pull the file with cronjob

Hi (again):

> I changed the permissions now 700. Before it was 777

...and so what happens now?

...JRF...
pv_2
Advisor

Re: Ftp script unable to pull the file with cronjob

I need wait till file to be placed again and i will watch,if cron job automatically pick up file or not.