Posts: 9
	Threads: 6
	Joined: Mar 2005
	
Reputation: 
0
	 
	
	
		
Hi all. I'm doing a Crontab assignment and I can't make out what the syntax for one of the questions is implying. Here it is:
 
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
 
From my textbook, I can make out the first 5 fields, but I have no idea what that command means. Does anyone know what that madness means?
	
	
	
	
	
 
 
	
	
	
		
	Posts: 292
	Threads: 45
	Joined: Dec 2003
	
Reputation: 
0
	 
	
	
		
the [-x /bla]  that tests to see if the program has execute rights (ie +x)
 
then if it does it will run that commnad. Thats what the && says. So if the command is exe'able.. run it.
 
The next part sends all output to /dev/null so you don't get a email of output from the command its defalt is sending all stdout to /dev/null.. thats the first part.
 
the 2>&1 means send the stderr into stdout. So it'll also send the stderr to /dev/null
	
	
	
	
	
 
 
	
	
	
		
	Posts: 1,229
	Threads: 45
	Joined: Mar 2005
	
Reputation: 
0
	 
	
		
		
		2005-03-31, 02:28 PM 
(This post was last modified: 2005-03-31, 02:29 PM by znx.)
		
	 
	
		
Just to inform you about the 'rtc' command. This command (only on Sol systems I believe) is used to adjust your 'Real Time Clock' to daylights savings (when it comes around).
 
The linux equivalent would be 'hwclock' iirc
	
	
	
	
	
 
 
	
	
	
		
	Posts: 9
	Threads: 6
	Joined: Mar 2005
	
Reputation: 
0
	 
	
	
		.. much appreciated. These commands can be really intimidating for noobs.