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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-10-2005, 01:47 AM
|
#1
|
LQ Newbie
Registered: Jan 2005
Location: Kerala
Posts: 16
Rep:
|
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
|
|
|
01-10-2005, 01:53 AM
|
#2
|
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
|
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
|
|
|
01-10-2005, 02:02 AM
|
#3
|
Member
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915
Rep:
|
If you're using KDE, there's a nice GUI frontend called "kcron."
|
|
|
01-10-2005, 02:14 AM
|
#4
|
LQ Newbie
Registered: Jan 2005
Location: Kerala
Posts: 16
Original Poster
Rep:
|
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.
|
|
|
01-10-2005, 02:24 AM
|
#5
|
Member
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915
Rep:
|
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.
|
|
|
01-10-2005, 02:44 AM
|
#6
|
LQ Newbie
Registered: Jan 2005
Location: Kerala
Posts: 16
Original Poster
Rep:
|
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
|
|
|
01-10-2005, 03:16 AM
|
#7
|
Member
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915
Rep:
|
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.
|
|
|
01-10-2005, 03:37 AM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
01-10-2005, 03:58 AM
|
#9
|
LQ Newbie
Registered: Jan 2005
Location: Kerala
Posts: 16
Original Poster
Rep:
|
oh thanx a lot this was realyy elaborate replyy..
Thanku very much 4 ur help.
|
|
|
All times are GMT -5. The time now is 12:46 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|