Dear Concerns,
I have backup script which TAR the data, makes one copy on local hardisk and then FTP to another machine. Last few days i m facing problem with it. The cron job only makes the copy automatically on local disk but doesnot automatically FTP to another machine.
I ran the script manually, the script runs successfully.
For trouble shooting i displayed the output in some file and shown this error:
Cron Entry is : */5 * * * * /opt/bin/ftp.sh 2> /tmp/error_log
"/opt/bin/ftp.sh: line 3: ftp: command not found"
Please help me out of this problem.
Regards,
Umair Shakil Askari Bank Limited
Quoting umair shakil umairshakeel@gmail.com:
Cron Entry is : */5 * * * * /opt/bin/ftp.sh 2> /tmp/error_log
"/opt/bin/ftp.sh: line 3: ftp: command not found"
Your shell script doesn't know where 'ftp' lives. Best to put the full path into place, '/usr/bin/ftp'
Dear Ashley,
Thanks for your reply. Well i have checked that ftp package is not installed. I install the package but didnot give the full path.
The problem is resolved; Very thanks man.
Regards,
Umair Shakil Askari Bank Limited
On 9/12/07, Ashley M. Kirchner ashley@pcraft.com wrote:
Quoting umair shakil umairshakeel@gmail.com:
Cron Entry is : */5 * * * * /opt/bin/ftp.sh 2> /tmp/error_log
"/opt/bin/ftp.sh: line 3: ftp: command not found"
Your shell script doesn't know where 'ftp' lives. Best to put the full path into place, '/usr/bin/ftp'
-- R | I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner mailto:ashley@pcraft.com . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Imaging . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
This message was sent using IMP, the Internet Messaging Program.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Quoting umair shakil umairshakeel@gmail.com:
I install the package but didnot give the full path.
It is a good practice to always provide a proper path, either through a PATH statement, or by issuing the full path to the binary.
Dear Salam!!!
Very thanks, yes its a good practice.
Regards,
Umair Shakil ETD
On 9/12/07, Ashley M. Kirchner ashley@pcraft.com wrote:
Quoting umair shakil umairshakeel@gmail.com:
I install the package but didnot give the full path.
It is a good practice to always provide a proper path, either through a PATH statement, or by issuing the full path to the binary.
-- R | I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner mailto:ashley@pcraft.com . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Imaging . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
This message was sent using IMP, the Internet Messaging Program.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Tue, 2007-09-11 at 23:38 -0600, Ashley M. Kirchner wrote:
Quoting umair shakil umairshakeel@gmail.com:
Cron Entry is : */5 * * * * /opt/bin/ftp.sh 2> /tmp/error_log
"/opt/bin/ftp.sh: line 3: ftp: command not found"
Your shell script doesn't know where 'ftp' lives. Best to put the full path into place, '/usr/bin/ftp'
As an (easier to maintain?) option, modify your shell script to source the appropriate /etc/bashrc and/or /etc/profile. Keep in mind the (non-)interactive nature of these two. "man bash" for more details.
This will mean that when you re-configure path information, or want to test a new program before trashing the old one, changes will be reduced and can be more easily isolated. This is especially true if the .bashrc/profile includes some tests for a user ID, like user test.
HTH -- Bill
umair shakil wrote:
Dear Concerns,
I have backup script which TAR the data, makes one copy on local hardisk and then FTP to another machine. Last few days i m facing problem with it. The cron job only makes the copy automatically on local disk but doesnot automatically FTP to another machine.
I ran the script manually, the script runs successfully.
For trouble shooting i displayed the output in some file and shown this error:
Cron Entry is : */5 * * * * /opt/bin/ftp.sh 2> /tmp/error_log
"/opt/bin/ftp.sh: line 3: ftp: command not found"
Hi,
Either modify the PATH environment variable in your script so that it includes /usr/bin or specify the ftp command that must be inside this script as /usr/bin/ftp rather than ftp.
Have a nice day :)
Please help me out of this problem.
Regards,
Umair Shakil Askari Bank Limited
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos