Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wrote this script to automate a daily FTP download with cron job. The script work when I run it manually. But, it won't execute anything from gpg portion of the script when it's run by cron job. Any suggestions?
How about splitting up stuff? I mean the grabbing and distributing stuff can be run unattended from a cronjob. Then you can do the decrypting when you're at the console. Putting the PGP passphrase in a script is a hazard itself and defeats any encryption purposes (IMNSHO).
unfortunately, this is a daily job and our business unit want this run automatically. I know run gpg passphrase in a script is not a great idea. But, this server is sitting inside 2 layers of Cisco firewall and I have iptables running on it.
Probably from crontab, it can't find the PATH to gpg command, since by default the crontab environment has a very limited PATH. You can check this by simply executing (from crontab) a
Code:
echo $PATH > somefile
Also you can check with the mail command, if you have received some error message from the crontab job. All this stuff on linux can be set in the crontab file. See
Code:
man 5 crontab
for details (look for setting MAILTO and PATH variables).
As you can see i modified the code with debug messages that he logs in $LOG (/var/log/boa_cron.log). Be sure to run this as root else you might not create the log files.
Now try to execute it in cron and see if it puts any output in /var/log/boa_cron.log. If it doesn't then it doesn't execute the script (properly).
As posted above, you can also try to run this script with bash -x but i didn't include it in this one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.