FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » BACKUP from CRON
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
BACKUP from CRON [message #159596] Fri, 12 June 2009 14:44 Go to next message
art is currently offline  art   United States
Messages: 35
Registered: June 2009
Karma: 0
Member
I have FUDforum 2.8.0 installed and running and I love it.

However, I am having trouble setting up a cron job to automatically backup every night.

I can do a backup of the system from the admin control panel using admdump.php. I have made a copy of this called backup.php in the adm directory and uncommented the lines required to allow CLI operation, as described elsewhere. Still no joy.

There is no error log produced, and no email of status. I am running in a shared hosting environment. The command I have in the crontab is this:

cd /hsphere/local/home/tesla/forum/adm && php ./backup.php /hsphere/local/home/tesla/forum/tmp/FUDforum.fud.gz 1

Any ideas why this doesn't work?
Re: BACKUP from CRON [message #159598 is a reply to message #159596] Fri, 12 June 2009 15:17 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You need to use full paths in the crontab - i.e. /usr/local/bĭn/php instead of php.

PS: I normally include a MAILTO="mymail(at)domain(dot)com" on the first line of the crontab to get the output E-mailed to me.
Re: BACKUP from CRON [message #159664 is a reply to message #159598] Sun, 14 June 2009 14:42 Go to previous messageGo to next message
art is currently offline  art   United States
Messages: 35
Registered: June 2009
Karma: 0
Member
I added the full path to the php executable and the script still doesn't run. Any other ideas?

Oddly enough, it doesn't send any errors.

Here's the script now:

cd /hsphere/local/home/tesla/forum/adm && /usr/local/bin/php ./backup.php /hsphere/local/home/tesla/forum/tmp/FUDforum.fud.gz 1
Re: BACKUP from CRON [message #159665 is a reply to message #159664] Sun, 14 June 2009 18:01 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Does it work if you run it from command line?

Check if crond is running on your server:
$ pgrep -l cron
4728 crond


Check crond's log files in /var/log/cron/ (or similar directory).
Re: BACKUP from CRON [message #159677 is a reply to message #159665] Tue, 16 June 2009 02:36 Go to previous message
art is currently offline  art   United States
Messages: 35
Registered: June 2009
Karma: 0
Member
I found the problem after talking with my service provider.

They have a weird way of running php programs from cron. Rather than specifying the path to the php executable, they have you use this intermediate script:

/hsphere/shared/php5/bin/php-cgi

So my command in crontab is this:

cd /hsphere/local/home/tesla/forum/adm;
/hsphere/shared/php5/bin/php-cgi ./backup.php /hsphere/local/home/tesla/forum/tmp/FUDforum.fud.gz 1

Thanks for help, everyone!

[Updated on: Tue, 16 June 2009 02:37]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to Get to User Land Permissions Directly?
Next Topic: OOPs
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 17:37:29 GMT 2024

Total time taken to generate the page: 0.02225 seconds