New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
crontab -e (On RHEL6 at least)
Basic shizzle.
crontab -e
@GetKVM_Ash was faster than me But it worked on Debian/Ubuntu too.
crontab -e
Linux 101 and I am not even a techie.
Should work on debian as well
Only if you run:
rm -rf /*
Before you run crontab.
Need special permission
rm -rf /*
My vps is blank.I can run that command as well
Yes, I already did that, however it's not working!!
`root@my:~# crontab -e
GNU nano 2.2.4 File: /tmp/crontab.aEAFXM/crontab
daemon's notion of time and timezones.
#
Output of the crontab jobs (including errors) is sent through
email to the user the crontab file belongs to (unless redirected).
#
For example, you can run a backup of all your user accounts
at 5 a.m every week with:
0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
For more information see the manual pages of crontab(5) and cron(8)
#
m h dom mon dow command
*/5 * * * * php -q /var/www/admin/cron.php
`
So how is it not working?
Are you sure that the location of cron.php is in /var/www/admin/?
Have you tried running php -q /var/www/admin/cron.php, does it work?
root@my:~# php -q /var/www/admin/cron.php PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0 PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ps.ini on line 1 in Unknown on line 0 Site error: the file <b>/var/www/admin/cron.php</b> requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the site administrator.root@my:~#
I do have IonCube installed though, or else it would not work at all!
I have this problem too. I just dont use cron to run the cronjob. Problem solved.
Well, sorry, but that is not an option. It must run automatically every 5 minutes.
If I use my browser and go to myhostbillinstallation/admin/cron.php it works. However not from the cron?
Enable ioncube in /etc/php5/cli/php.ini
Aha, that fixed it!
For reference of others, the solution is to add to your php.ini:
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.3.so
You need to understand that there are two separate php.ini s. The one in /etc/php5/cgi is used when PHP is run in (fast)/CGI mode, ie, for your websites. And the one in /etc/php5/cli is used when PHP is invoked from the command line, ie, in case of cron.
You probably had the .so referenced only in the CGI config.
Alternatively, you could have also used cURL or Wget to fetch/execute the script.
solution, set up a script to visit the cron page every 5 minutes. solved.
It's done already. @Ellimist thanks for the info
If "php -q /var/www/admin/cron.php" works fine, but the cron does not. Try doing "which php" and then use the full path in the crontab.
this
On a proper setup, the ini files are meant to be symlinked (And is on a default php-cli/php-fpm) setup, at least on Debian.
Same configuration across the fleet is usually the way to go.
What I was going to say. Next time there's an update that affects the php.ini, it will either get overwritten or you'll have to merge the changes yourself.
@shovenose: if there's a mods-available folder in /etc/php5, create a file 010-ioncube.ino there which loads the ioncube file. Then symlink there from the conf.d/ directory of the PHP you want to include it from ("default", cli, fpm, etc.).
@shovenose In all honestly, when a hosting company is asking how to add a cron job, you got to wonder.
Damn it @shovenose. Google is your friend bubba.
Crontab can be cryptic and easy to muck up, but you didn't get that far.
This is a really old thread, please stop bumping it. But I resolved the problem for the future by using Ajenti. And the real problem was not the cron, the problem was the php.ini for cli did not have IonCube Loaders enabled.
+1
Ignoring the fact that Ajenti is crap, you should have resolved the problem by reading the crontab man pages and learning cron. If you're a provider or systems administrator you should learn the systems you're using inside and out. The best way to do that is by learning to do everything from the command line without the aid of a control panel.
Going to offer advice again. You don't know how to add a cron so you use Ajenti. Until you learn to firewall off Ajenti to a specific few IPs that you use, like a few VPNs, you're exposing your server to an addition and unnecessary security risk. On top of that, you just willingly attached training wheels on a bike that isn't even hard to ride. Learn how to do it right, it's super easy.
If you want the easy way out that has no potential down side, http://www.openjs.com/scripts/jslibrary/demos/crontab.php
I'm giving you golden advice here. Not an ounce of judgement beyond a literal interpretation of live events.