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

Home » FUDforum » How To » BACKUP from CRON
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
BACKUP from CRON [message #159596] Fri, 12 June 2009 10:44 Go to next message
Tesla Rider is currently offline  Tesla Rider   United States
Messages: 20
Registered: June 2009
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 11:17 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 10:42 Go to previous messageGo to next message
Tesla Rider is currently offline  Tesla Rider   United States
Messages: 20
Registered: June 2009
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 14:01 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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] Mon, 15 June 2009 22:36 Go to previous message
Tesla Rider is currently offline  Tesla Rider   United States
Messages: 20
Registered: June 2009
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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: Mon, 15 June 2009 22:37]

Report message to a moderator

Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Tue Dec 12 14:50:29 EST 2017

Total time taken to generate the page: 0.00723 seconds