To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Linux/Unix Help

Linux/Unix Help Help with server-side Linux and Unix issues

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-19-2002, 10:11 PM   #1
syrocax
Junior Member
 
Join Date: Aug 2002
Posts: 4
Question Midnight Backups

I don't have much experience in PHP. But it would be neat to have a script for scheduled backups, I tought.
Script is OK. But how to run it automaticly if possible?

I am working on a rented space supporting PHP 4 operated by linux...

I couldn't come up with anything instead of configuring the script to run by a button and then setting the alarm-clock
syrocax is offline   Reply With Quote
Old 08-19-2002, 10:18 PM   #2
jstarkey
Civilian
 
jstarkey's Avatar
 
Join Date: Jul 2002
Location: 9500 ft
Posts: 1,104
Log into the server via telnet or ssh and type:

crontab -e

Move to a blank line, then type:

i

and:

05 * * * * /path/to/the/script

then:

ZZ

(this is all assuming you have vi set as your editor.)

The 05... tells cron to run the job 5 mins after midnight, each night.
jstarkey is offline   Reply With Quote
Old 08-19-2002, 10:27 PM   #3
syrocax
Junior Member
 
Join Date: Aug 2002
Posts: 4
Thank you. You have another happy coder now...
syrocax is offline   Reply With Quote
Old 08-20-2002, 05:10 AM   #4
Sxooter
Chamberlain
 
Sxooter's Avatar
 
Join Date: Aug 2002
Location: Denver, CO
Posts: 4,056
Actually, that line should be 5 0 * * * for the crontab. The one there runs 5 minutes after every hour. Also useful, but probably not exactly what you need at noon under load.

Do 'man 5 crontab' to get a listing of all the configuration settings for crontab. also, look at the /etc/crontab on a redhat or similar box to see what time root runs so you aren't competing too much for CPU/IO when you do your cron jobs.
__________________
PostgreSQL version 8.4 is now in beta! New features in the works: Updateable Views, WITH queries including recursive, On-disk bitmap indexes, and improved partitioning. woot!
Sxooter is offline   Reply With Quote
Old 08-21-2002, 03:00 AM   #5
jstarkey
Civilian
 
jstarkey's Avatar
 
Join Date: Jul 2002
Location: 9500 ft
Posts: 1,104
Yep, sorry. Was thinking in another timeframe

Another good way to do backups is to put a script in /etc/cron.daily and it will be executed each day. This way, you just drop the script in the folder and it will be executed in turn.
jstarkey is offline   Reply With Quote
Old 08-22-2002, 12:28 AM   #6
teddyjas
Junior Member
 
Join Date: Aug 2002
Location: Singapore
Posts: 6
i'm using the following crontab to do my daily reports run at midnight:
0 0 * * * php report.php >/dev/null

maybe it helps
teddyjas is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 03:39 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.