LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2005, 12:47 AM   #1
Haric
LQ Newbie
 
Registered: Jan 2005
Location: Kerala
Posts: 16

Rep: Reputation: 0
Scheduling Tasks How to


Hai..
Iam having two servers with redhat9.0 loaded on both.Iam using mysql as my database.One server is being kept as a backup server.
My problem is that ,I want a script which is to be executed in such a way that it takes bakup of my database automatically in the scheduled time and transfer it to my backup server.
In nutshell how to execute a script on a scheduled time say 5:00 PM every day,and how to transfer it to another machine which in the network.

Expecting ur valuable suggestions
With regards
Hari
 
Old 01-10-2005, 12:53 AM   #2
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
I can't write the script for you, but you need to schedule it with cron.

Add a line to /etc/crontab (You will need to be root), such as:
Code:
00 17 * * *     scriptName
This means that the script is run at 5pm, every day.

man cron for more details

--Ian
 
Old 01-10-2005, 01:02 AM   #3
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
If you're using KDE, there's a nice GUI frontend called "kcron."
 
Old 01-10-2005, 01:14 AM   #4
Haric
LQ Newbie
 
Registered: Jan 2005
Location: Kerala
Posts: 16

Original Poster
Rep: Reputation: 0
Thanx for ur reply..

Ok so scheduleuing can be done using crond ,but is it posible to copy a particular file to another network machine (also rh9.0) automatically i mean in the same script .i.e once backup is taken in the scheduled time i want to copy that to another machine automatically.
 
Old 01-10-2005, 01:24 AM   #5
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally posted by Haric
Thanx for ur reply..

Ok so scheduleuing can be done using crond ,but is it posible to copy a particular file to another network machine (also rh9.0) automatically i mean in the same script .i.e once backup is taken in the scheduled time i want to copy that to another machine automatically.
I would share out the destination folder of your other RH9 machine and mount it on your primary RH9 machine where the database files reside. Then it's a simple matter of copying the files to the shared partition.

That's exactly how I back up my mail archive files on a weekly basis.
 
Old 01-10-2005, 01:44 AM   #6
Haric
LQ Newbie
 
Registered: Jan 2005
Location: Kerala
Posts: 16

Original Poster
Rep: Reputation: 0
Hai..
Thanks for the reply..

but as iam a newbie in linux i couldnt get all that u ve said .how can i share it did u mean by using SAMBA server or anything like that.and oce its shared how to mount it..

Thanks in advance
 
Old 01-10-2005, 02:16 AM   #7
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally posted by Haric
but as iam a newbie in linux i couldnt get all that u ve said .how can i share it did u mean by using SAMBA server or anything like that.and oce its shared how to mount it..
You need to run a service called "nfs" on the machine that shares out the partition. Samba is for sharing your Linux partitions with Windows clients. Between Linux machines, all you need is NFS ("nfs").

http://nfs.sourceforge.net/nfs-howto/server.html

Once you have your destination folder shared out on the second machine, you use the "mount" command on the primary machine to mount it. For instance:
Code:
# mount -t nfs rh9-2:/share /mnt/share -o rw
This mounts the shared folder "/share" of your second machine (which I arbitrarily call "rh9-2") on your primary machine as /mnt/share. If you're familiar with Windows folder sharing, it's something like this:
Code:
C:\> net use m: \\rh9-2\share
Run "man mount" to see more details about the "mount" command.
 
Old 01-10-2005, 02:37 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Here is a Linux-Gazette article which contains a mysql backup script using a php script. If you use something like this, make sure that the script is not world readable, since it contains passwords.
 
Old 01-10-2005, 02:58 AM   #9
Haric
LQ Newbie
 
Registered: Jan 2005
Location: Kerala
Posts: 16

Original Poster
Rep: Reputation: 0
oh thanx a lot this was realyy elaborate replyy..
Thanku very much 4 ur help.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scheduled tasks? onionkn1ght Linux - Software 3 01-11-2005 10:20 PM
<Defunct> in Tasks cb951303 Slackware 1 02-24-2004 11:56 AM
Need some tasks AMDPwred Linux - General 5 02-28-2003 03:22 PM
Scheduling Tasks? gauge73 Linux - General 1 01-28-2003 11:56 AM
Scheduled tasks... beserier Linux - General 1 01-24-2003 08:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration