[SOLVED] Difference between manual run and crontab run?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
My predecessor wrote a perl file that is run manually twice a month to send a set of emailed reports to one of our clients. My boss has requested that I look into automating this; it seemed simple enough, and I thought I had it set up, but I'm running into a rather strange problem.
Both the emailing program (in perl) and the report files themselves are kept on a Novell server reached from our Linux box via /mnt/srv/path/to/file/. From the linux box, I can see and manipulate them fine. The files are displayed as having 755 permissions across the board. The Linux box itself is running SuSE 9.3.
A manual run of the emailing program works fine; the files are sent out as expected. However, when I tried to set up a crontab entry for this, I'm running into trouble. I manually edited /etc/crontab to include a line setting the program to run at '0 21 * * 1,2,3,4,5'. The program itself runs fine, but errors out every time it tries to attach a file; the error message is one that various perl sites indicate means 'could not read the path to this file'.
What's the difference between a cron run and a manual run? What are some possible reasons the former fails and the latter works?
What user is the crontab run as? Is it run as root?
Are all of the paths fully qualified? I believe when a cron job runs, it doesn't run with the environment variables you have when you are logged in the shell.
Thank you for pointing that out.
There was a point in the code where it was looking for a relative path to a file; I've personally run that file manually from multiple directories before and had it work, so that particular path may have been in the environment variables for my login. Coding the path into place ahead of it allowed a crontab run to go ahead successfully; thank you for your assistance.