Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th August 2010, 00:05
ethanlifka ethanlifka is offline
Junior Member
 
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 6 Times in 4 Posts
Default Crons not running from Sites -> Crons

Whenever I create a cron using the Sites->Cron Jobs they wont run. However the same crons run fine in crontab.

Not only that they are not running, but there is no output.

I noticed that when creating a Client it has settings for Crons, But I only have one site and therefore have no clients.
I am doing it all from my admin.

Is that why the crons are not running?

Does the Admin by default have no Cron Authority?

I am using CentOS 5.4, ISPC 3.0.1.6
Reply With Quote
Sponsored Links
  #2  
Old 4th August 2010, 10:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

Most likely you try to start progrems with cron that are not within the jail of the cronjob.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 15th August 2010, 00:21
ethanlifka ethanlifka is offline
Junior Member
 
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 6 Times in 4 Posts
Default

I am just trying to run a php file.

0 * * * * /usr/bin/php -q /var/www/clients/client0/web1/cron.php &> /dev/null


I don't want to use Wget cause I like to keep my crons private. I know there are ways to protect public cron files, but i still like them in the private folder.

This cron runs fine in crontab, but when in Sites -> Cron it wont run.
The file and folder are owned by the web1 user.

I am getting no output or logging.

Does a client have to be created in order to run the cron?
Reply With Quote
  #4  
Old 17th August 2010, 16:04
wahid wahid is offline
Junior Member
 
Join Date: Aug 2010
Location: Hamburg, Germany
Posts: 22
Thanks: 2
Thanked 3 Times in 2 Posts
Question

I'm getting the same problem with a simple backup.sh Script, which I tried to run with the default admin client to backup my website automatically.
So I went through the Cron-Menu in ISPConfig adding a record which contains:
Code:
0      0     *      *       0       web5    /var/www/clients/client0/web5/BackupScript.sh
I created previously a shell user for the concerned website, who has "none" for the Chroot Shell option.

When I looked into /var/log/ispconfig/cron.log, there was no output and some errors are shown:
Code:
/usr/local/ispconfig/server/scripts/create_jailkit_chroot.sh: line 24: jk_init: command not found
mkdir: cannot create directory `/var/www/clients/client0/web5/var': File exists
mkdir: cannot create directory `/var/www/clients/client0/web5/var/run': File exists
mkdir: cannot create directory `/var/www/clients/client0/web5/var/run/mysqld': File exists
ln: creating hard link `/var/www/clients/client0/web5/var/run/mysqld/mysqld.sock': File exists
/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh: line 20: jk_cp: command not found
/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh: line 20: jk_cp: command not found
/usr/local/ispconfig/server/scripts/create_jailkit_user.sh: line 25: jk_jailuser: command not found
usermod: no changes
When I run manually the script with the user "web5", everything works out of the box.

So what's missing?
Reply With Quote
  #5  
Old 17th August 2010, 17:35
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

I've been having problems with crons as well in the past .. the thing is, stuff like PATH env vars aren't there, or aren't the same as if you'd run them from the CLI ..

especially when you jailroot .. you ned to make sure the files you need are within your root
Reply With Quote
  #6  
Old 17th August 2010, 17:52
wahid wahid is offline
Junior Member
 
Join Date: Aug 2010
Location: Hamburg, Germany
Posts: 22
Thanks: 2
Thanked 3 Times in 2 Posts
Question

...but even I create a non-chroot shell user, I assume that ISPConfig is still assigning the new created user jailroot attributes !
So this is what I found in the created crontab:
Code:
MAILTO=''

SHELL='/usr/sbin/jk_chrootsh'

45	16	*	*	2	web5     /BackupWpress.sh
As said even I assign it "none" by the chroot option, you see here the cronjob got something related to jailrooted users "SHELL='/usr/sbin/jk_chrootsh'"

And I used of course full path in my script ! Unforunately this feature is really still confusing on ispconfig.

Any idea?
Reply With Quote
  #7  
Old 20th August 2010, 15:17
wahid wahid is offline
Junior Member
 
Join Date: Aug 2010
Location: Hamburg, Germany
Posts: 22
Thanks: 2
Thanked 3 Times in 2 Posts
Default

I decided to give up and set up a crontab manually to perform the backup. It seems not working at all when I use ISPConfig.
Reply With Quote
  #8  
Old 20th August 2010, 17:30
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

what's inside BackupWpress.sh?
Reply With Quote
  #9  
Old 20th August 2010, 18:03
wahid wahid is offline
Junior Member
 
Join Date: Aug 2010
Location: Hamburg, Germany
Posts: 22
Thanks: 2
Thanked 3 Times in 2 Posts
Question

This simple script:

Code:
#!/bin/sh


# Backup "website.tld" /var/www/clients/client0/web5/web
nice -n 17 /bin/tar -cjvvf /var/www/clients/client0/web5/backups/website.tld.`/bin/date +%Y%m%d`.tar.bz2 /var/www/clients/client0/web5/web

# Dump "website.tld" Website database
nice -n 17 /usr/bin/mysqldump --verbose --user=userName --password=secret --add-drop-table dbName> /var/www/clients/client0/web5/backups/website.tld.`/bin/date +%Y%m%d`.sql
nice -n 17 /bin/bzip2 /var/www/clients/client0/web5/backups/website.tld.`/bin/date +%Y%m%d`.sql
Reply With Quote
  #10  
Old 20th August 2010, 20:36
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
 
Default

is nice available from jailroot as well?
Reply With Quote
Reply

Bookmarks

Tags
cron

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 4 TPS mail problem Hagforce HOWTO-Related Questions 13 10th February 2010 19:23
High on Lenny - Lvm Mount Problem Serverman Technical 1 23rd June 2009 17:26
[SharedIP] Server will not serve sites? giganet General 6 30th May 2009 18:54
High Availability Samba cluster - DRBD + Heartbeat djalex Server Operation 58 25th May 2007 20:38
Multiple sites -> same admin user merlincc General 1 24th December 2006 12:52


All times are GMT +2. The time now is 12:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.