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!
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.
Hello. Linux newb and first time poster, here. I'm sure it won't be the last
So, I've got a bitnami VM on AWS and I'm trying to get cron running a PHP script every minute. I've read through a gazillion other threads on this issue, but just can't fathom it.
note that I've now switched to a simple shell script rather than my original php script, to try to get it working (doesn't). The second like does actually work though. So...
Definitely check mail using eg mailx, both as root and as the job owner.
Also, I'd be inclined to always specify full absolute paths to all cmds/files referenced eg that logs.txt file.
Easiest way is to just explicitly call a shell file in cron, then (after the shebang line eg '#!/bin/bash'', in the next line) set PATH explicitly as reqd for your prog eg copy the content of your .bash_profile.
a basic way to debug bash is to use
Code:
set -xv
after the shebang line; it shows what the parser is doing.
In cron you'll prob get the output emailed, although you can also do
Code:
* * * * * /dir/t.sh >/tmp/t.log 2>&1
PS always use 'crontbab -e' to edit your cron file. If you edit it directly cron daemon may not be notified of the change.
I want to download cron pdf for learning can anyone provide me the link to download it.
Hello,
Please do not thread jack other people's threads. If you have a serious question, search these forums first, and if you can not find the answer you are looking for, then by all means create a new thread. Now as far as your "question," try search online, specifically on google, for "cron guide" and you will find quite a few results.
You shouldn't be setting your permissions like that, you'll get pwned. You've set the script that you're running from cron to be world-writable, and put it in the tmp directory. If anybody gets access to your machine, they can change that script to whatever they want, and if they are malicious, you can wave bye-bye to your machine and your precious data. You should never set any executable to be world-writable. There is no need for it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.