LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-12-2008, 09:18 PM   #1
ghostmac
LQ Newbie
 
Registered: Oct 2005
Posts: 15

Rep: Reputation: 0
Cron'd rsync process out of control.


Greetings Gurus,
My desktop machine is a 64 bit version of Ubuntu 8.04.1, 2.6.24-21 kernel and using rsync version 2.6.9 protocol version 29.

I recently added a 1Tb drive to the setup (XFS) to handle backups.
I tossed the rsync command;
Code:
rsync -avh --progress --delete --exclude-from=/root/.rsync/exclude /home /media/sdc1/
into a file and scheduled it to run once a day at 5am via;
Code:
# m h  dom mon dow   command
* 5 * * * /root/.rsync/.homes_sync>/dev/null 2>&1
.
Everything seems to work fine though once in a while (once every two weeks or so), I'll wake up and there will be +30 instances of rsync running bogging down the system.
I look at my logs and;
Code:
Nov 12 05:00:01 Balius /USR/SBIN/CRON[18858]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:01:02 Balius /USR/SBIN/CRON[21872]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:02:02 Balius /USR/SBIN/CRON[24874]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:03:02 Balius /USR/SBIN/CRON[27890]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:04:02 Balius /USR/SBIN/CRON[30920]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:05:02 Balius /USR/SBIN/CRON[1464]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:06:02 Balius /USR/SBIN/CRON[4488]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:07:07 Balius /USR/SBIN/CRON[7678]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:08:01 Balius /USR/SBIN/CRON[10693]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
Nov 12 05:09:11 Balius /USR/SBIN/CRON[13718]: (root) CMD (/root/.rsync/.homes_sync>/dev/null 2>&1)
. . . .and so on until 5:59am.

My question is A.Is my job not scheduled correctly and B.If it is, why does this only happen once in a while?

I would think that if the scheduling is incorrect, it may run every 5 hours or every 5 min, but once a min for an hour?

My apologies if this is obvious.
 
Old 11-12-2008, 09:28 PM   #2
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
If you notice that you have your crontab set to run every minute from 5:00 a.m.
Code:
# m h  dom mon dow   command
* 5 * * * /root/.rsync/.homes_sync>/dev/null 2>&1
The * in the minute specification runs every minute during the 5 o'clock hour.

If you want to execute your command once you must specify a single time such as:
Code:
# m h  dom mon dow   command
0 5 * * * /root/.rsync/.homes_sync>/dev/null 2>&1
This will run your command only once at 5:00 a.m. daily.
Code:
# m h  dom mon dow   command
30 5 * * * /root/.rsync/.homes_sync>/dev/null 2>&1
This will run your command only once at 5:30 a.m. daily.

Last edited by AuroraCA; 11-12-2008 at 09:32 PM.
 
Old 11-12-2008, 09:30 PM   #3
ghostmac
LQ Newbie
 
Registered: Oct 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks!
I've edited the cron entry hopefully that'll be the end of it.
 
  


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
time control process sunlinux Programming 4 12-16-2006 08:44 PM
Process Table-Process Control Block sarahmencer Linux - General 1 01-09-2006 09:14 PM
Process control...? kleptophobiac Linux - General 2 09-25-2004 10:03 AM
Regaining Process Control mikeyt_333 Linux - General 5 03-21-2002 02:21 PM
apache, process owner, and rsync/ssh question Kruel Linux - Networking 0 03-01-2002 12:25 PM

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

All times are GMT -5. The time now is 12:12 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