Unix/Linux Go Back    


Fedora is an operating system centered on the Linux open source kernel and is developed by the community-supported Fedora Project. Fedora is sponsored by Red Hat. Fedora contains software distributed under a free and open-source license. Fedora focuses on innovation, integrating and adopting new technologies and working closely with various Linux communities. The default desktop in Fedora is the GNOME desktop environment and the default user interface is the GNOME Shell. Other desktop environments include KDE Plasma, Xfce, LXDE, MATE and Cinnamon. Security is an important aspect of Fedora with one specific security feature, Security-Enhanced Linux, implementing a variety of software security policies, including mandatory access controls.

Accuracy of jobs scheduled in cron

Fedora


Closed    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 12-11-2013
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 19 July 2017, 2:30 PM EDT
Location: Loughborough
Posts: 1,212
Thanks: 364
Thanked 322 Times in 252 Posts
I am missing something here...

I suggest you re-read JM's and vbe's posts again and absorb what they are saying...

You want realtime access through a cron job to a set of files stored somewhere iside your networking ether that are constantly being read from and written to?

I would have thought your _HDD_ thrashing I/O was the biggest bottleneck assuming that you ARE suggesting real _files_...

This is not an easy task even for the big guns...
Sponsored Links
    #9  
Old Unix and Linux 12-11-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 21 July 2017, 2:59 PM EDT
Location: Saskatchewan
Posts: 22,291
Thanks: 1,110
Thanked 4,204 Times in 3,888 Posts
Quote:
Originally Posted by faka View Post
Dear Corona, I need to parse some text files and send the results in more precise or approximate time, 1 second after the data no longer serve because they change constantly.
It is the application's job to tell you when it is done, then. Cron cannot do this, and it is not correct to assume your application is always ready at exactly the right time. What is your application?
Sponsored Links
    #10  
Old Unix and Linux 12-11-2013
faka faka is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 8 October 2014, 9:42 AM EDT
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Corona688 View Post
It is the application's job to tell you when it is done, then. Cron cannot do this, and it is not correct to assume your application is always ready at exactly the right time. What is your application?
Corona688, first want to run this script at a certain time at the exact millisecond and get the results I asked in the first post if cron or if there is any alternative, I get the results can be either a file on disk and can also be a variable in memory.
    #11  
Old Unix and Linux 12-11-2013
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 19 July 2017, 2:30 PM EDT
Location: Loughborough
Posts: 1,212
Thanks: 364
Thanked 322 Times in 252 Posts
A little bit of lateral thinking here.
Instead of relying on the accuarcy of the cron job's timings why not create a shell script and let it run in the backround, OR, inside a visible terminal continuously...

Code:
#!/bin/sh
variable="The quick brown fox jumps over the lazy dog."
epochtime=$(date +%s)
newtime=$[ ( $epochtime + 10 ) ]

echo "$variable" > /tmp/sometext.txt
while true
do
	epochtime=$(date +%s)
	if [ $epochtime -le $newtime ]
	then
		read text < /tmp/sometext.txt
		variable=$text
		echo "Epochtime $epochtime = $(date)."
		echo "$text"
		echo "$variable"
		sleep 0.5
	else
		echo ""
		echo "Setting new time slot 10 seconds later..."
		echo ""
		epochtime=$(date +%s)
		newtime=$[ ( $epochtime + 10 ) ]
	fi
done

Results using the "sleep 0.5" in the code...
Apologies for the long printout...

Code:
Last login: Thu Dec 12 02:55:23 on ttys000
AMIGA:barrywalker~> chmod 755 timejob.sh
AMIGA:barrywalker~> ./timejob.sh
Epochtime 1386817822 = Thu 12 Dec 2013 03:10:22 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817822 = Thu 12 Dec 2013 03:10:22 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817823 = Thu 12 Dec 2013 03:10:23 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817823 = Thu 12 Dec 2013 03:10:23 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817824 = Thu 12 Dec 2013 03:10:24 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817824 = Thu 12 Dec 2013 03:10:24 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817825 = Thu 12 Dec 2013 03:10:25 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817825 = Thu 12 Dec 2013 03:10:25 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817826 = Thu 12 Dec 2013 03:10:26 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817826 = Thu 12 Dec 2013 03:10:26 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817827 = Thu 12 Dec 2013 03:10:27 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817827 = Thu 12 Dec 2013 03:10:27 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817828 = Thu 12 Dec 2013 03:10:28 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817828 = Thu 12 Dec 2013 03:10:28 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817829 = Thu 12 Dec 2013 03:10:29 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817829 = Thu 12 Dec 2013 03:10:29 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817830 = Thu 12 Dec 2013 03:10:30 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817830 = Thu 12 Dec 2013 03:10:30 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817831 = Thu 12 Dec 2013 03:10:31 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817831 = Thu 12 Dec 2013 03:10:31 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817832 = Thu 12 Dec 2013 03:10:32 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817832 = Thu 12 Dec 2013 03:10:32 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.

Setting new time slot 10 seconds later...

Epochtime 1386817833 = Thu 12 Dec 2013 03:10:33 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817833 = Thu 12 Dec 2013 03:10:33 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817834 = Thu 12 Dec 2013 03:10:34 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817834 = Thu 12 Dec 2013 03:10:34 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817835 = Thu 12 Dec 2013 03:10:35 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817835 = Thu 12 Dec 2013 03:10:35 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817836 = Thu 12 Dec 2013 03:10:36 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817836 = Thu 12 Dec 2013 03:10:36 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817837 = Thu 12 Dec 2013 03:10:37 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817837 = Thu 12 Dec 2013 03:10:37 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817838 = Thu 12 Dec 2013 03:10:38 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817838 = Thu 12 Dec 2013 03:10:38 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817839 = Thu 12 Dec 2013 03:10:39 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817839 = Thu 12 Dec 2013 03:10:39 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817840 = Thu 12 Dec 2013 03:10:40 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817840 = Thu 12 Dec 2013 03:10:40 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817841 = Thu 12 Dec 2013 03:10:41 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817841 = Thu 12 Dec 2013 03:10:41 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817842 = Thu 12 Dec 2013 03:10:42 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817842 = Thu 12 Dec 2013 03:10:42 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817843 = Thu 12 Dec 2013 03:10:43 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817843 = Thu 12 Dec 2013 03:10:43 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.

Setting new time slot 10 seconds later...

Epochtime 1386817844 = Thu 12 Dec 2013 03:10:44 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817844 = Thu 12 Dec 2013 03:10:44 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817845 = Thu 12 Dec 2013 03:10:45 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817845 = Thu 12 Dec 2013 03:10:45 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817846 = Thu 12 Dec 2013 03:10:46 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817846 = Thu 12 Dec 2013 03:10:46 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817847 = Thu 12 Dec 2013 03:10:47 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817847 = Thu 12 Dec 2013 03:10:47 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817848 = Thu 12 Dec 2013 03:10:48 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817848 = Thu 12 Dec 2013 03:10:48 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817849 = Thu 12 Dec 2013 03:10:49 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817849 = Thu 12 Dec 2013 03:10:49 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817850 = Thu 12 Dec 2013 03:10:50 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817850 = Thu 12 Dec 2013 03:10:50 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817851 = Thu 12 Dec 2013 03:10:51 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817851 = Thu 12 Dec 2013 03:10:51 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817852 = Thu 12 Dec 2013 03:10:52 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817852 = Thu 12 Dec 2013 03:10:52 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817853 = Thu 12 Dec 2013 03:10:53 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817853 = Thu 12 Dec 2013 03:10:53 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817854 = Thu 12 Dec 2013 03:10:54 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.

Setting new time slot 10 seconds later...

Epochtime 1386817855 = Thu 12 Dec 2013 03:10:55 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
Epochtime 1386817855 = Thu 12 Dec 2013 03:10:55 GMT.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
^C
AMIGA:barrywalker~> _


Last edited by wisecracker; 12-11-2013 at 10:35 PM.. Reason: Typo...
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron Jobs not running at scheduled time vamshigvk475 Red Hat 2 08-12-2013 08:55 AM
List all daily scheduled cron jobs from my cronfile sureng Shell Programming and Scripting 1 07-27-2010 02:02 PM
where to check scheduled jobs in SunOS dba Solaris 2 03-29-2008 01:34 PM
problem when the script is scheduled to run as cron job forumthreads UNIX for Dummies Questions & Answers 6 07-19-2007 12:27 PM
Jobs scheduled in crontabs are not running after a migration to oracle 9i alexcol UNIX for Advanced & Expert Users 4 03-27-2007 10:35 PM



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