Sponsored Content
Operating Systems Solaris Solaris 9 Zone : Date command in crontab shows delayed(One Hour) output Post 302770901 by judi on Tuesday 19th of February 2013 02:08:06 AM
Old 02-19-2013
Thanks for your reply jlliagre
the time zone is properly set and even server had a reboot after the time zone settings..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

getting the date in crontab command

Hi All, There is a requirement to create a file everyday using the cronjob with the date as its name. any suggestions for the crontab command that'll serve this purpose? e.g. 02 30 * * * touch abcd.`date +%d.%m.%y` needless to say.. this doesn't work.. looking fwd to lots of... (7 Replies)
Discussion started by: pranavagarwal
7 Replies

2. Shell Programming and Scripting

Getting date output based on time zone

Hi, We have a server in US and hence while the command "date" is given it gives the output in EDT. If I want the date output in MET, how can I get it. Please let me know how I could do it in the script which is ksh. Thanks. (1 Reply)
Discussion started by: jmathew99
1 Replies

3. Solaris

prtdiag output for Solaris on Fujitsu hardware shows vendor as Sun Microsystems

Hello, I was under the impression that the Header of the prtdiag output shows the hardware vendor information in the section between System Configuration and sun4u/sun4us. But on some Solaris machines which are running on Fujitsu hardware, the vendor is shown as Sun Microsystems in this... (8 Replies)
Discussion started by: chattygk
8 Replies

4. Solaris

Solaris Crontab & TOP output

Hello Guru's I'm trying to take the output of solaris top command and output to a txt file every few minutes. The issue that I'm experiencing is that I can run the following: #!/bin/bash # logfile="/usr/mvf/morris/top.log" # echo... (2 Replies)
Discussion started by: littlemorris
2 Replies

5. Solaris

Df -k command shows duplicate information in Solaris machine, How to get the exact disk space

While getting the total disk space in solaris machine using df -k command, i am getting the same disk info for every user available in that system. Is there any way to remove it. Filesystem 1024-blocks Used Available Capacity Mounted on rpool/ROOT/solaris 573898752... (3 Replies)
Discussion started by: prasankn
3 Replies

6. UNIX for Dummies Questions & Answers

Crontab in Solaris zone

Hi, I created some cron entries in one of the 4 zones in Solaris 10. Now I want to edit it and unable to find the crontab file crontab -l gives : unable to open crontab file /usr/spool/cron/crontabs doesn't have the crontab file Hence, I did ifconfig -a and tried to login with the 3... (2 Replies)
Discussion started by: Rossdba
2 Replies

7. Solaris

Global Zone getting crontab info from zone

Hi, First post. I have a script that I am having a little trouble with and I hope someone can help. I will post the code for your input, but I want to read the lines of a file and use this as input to a command in a while loop... #!/bin/sh # # ### Variables MSG=/tmp/tmptest.txt... (7 Replies)
Discussion started by: dakelly
7 Replies

8. Solaris

Solaris 11 Global zone patching having Solaris 10 branded zone

I am planning to do solaris 11 global zone patching having solaris 10 branded zone. I have a doubts on step 8 specially Can someone clear my step 8 doubts or if anything wrong between step 1 to step 9 please correct that also as I have pretty good idea about Step 10 mean patching in solaris 10... (2 Replies)
Discussion started by: amity
2 Replies
DateTime::Event::Cron(3pm)				User Contributed Perl Documentation				DateTime::Event::Cron(3pm)

NAME
DateTime::Event::Cron - DateTime extension for generating recurrence sets from crontab lines and files. SYNOPSIS
use DateTime::Event::Cron; # check if a date matches (defaults to current time) my $c = DateTime::Event::Cron->new('* 2 * * *'); if ($c->match) { # do stuff } if ($c->match($date)) { # do something else for datetime $date } # DateTime::Set construction from crontab line $crontab = '*/3 15 1-10 3,4,5 */2'; $set = DateTime::Event::Cron->from_cron($crontab); $iter = $set->iterator(after => DateTime->now); while(1) { my $next = $iter->next; my $now = DateTime->now; sleep(($next->subtract_datetime_absolute($now))->seconds); # do stuff... } # List of DateTime::Set objects from crontab file @sets = DateTime::Event::Cron->from_crontab(file => '/etc/crontab'); $now = DateTime->now; print "Now: ", $now->datetime, " "; foreach (@sets) { my $next = $_->next($now); print $next->datetime, " "; } # DateTime::Set parameters $crontab = '* * * * *'; $now = DateTime->now; %set_parms = ( after => $now ); $set = DateTime::Event::Cron->from_cron(cron => $crontab, %set_parms); $dt = $set->next; print "Now: ", $now->datetime, " and next: ", $dt->datetime, " "; # Spans for DateTime::Set $crontab = '* * * * *'; $now = DateTime->now; $now2 = $now->clone; $span = DateTime::Span->from_datetimes( start => $now->add(minutes => 1), end => $now2->add(hours => 1), ); %parms = (cron => $crontab, span => $span); $set = DateTime::Event::Cron->from_cron(%parms); # ...do things with the DateTime::Set # Every RTFCT relative to 12am Jan 1st this year $crontab = '7-10 6,12-15 10-28/2 */3 3,4,5'; $date = DateTime->now->truncate(to => 'year'); $set = DateTime::Event::Cron->from_cron(cron => $crontab, after => $date); # Rather than generating DateTime::Set objects, next/prev # calculations can be made directly: # Every day at 10am, 2pm, and 6pm. Reference date # defaults to DateTime->now. $crontab = '10,14,18 * * * *'; $dtc = DateTime::Event::Cron->new_from_cron(cron => $crontab); $next_datetime = $dtc->next; $last_datetime = $dtc->previous; ... # List of DateTime::Event::Cron objects from # crontab file @dtc = DateTime::Event::Cron->new_from_crontab(file => '/etc/crontab'); # Full cron lines with user, such as from /etc/crontab # or files in /etc/cron.d, are supported and auto-detected: $crontab = '* * * * * gump /bin/date'; $dtc = DateTime::Event::Cron->new(cron => $crontab); # Auto-detection of users is disabled if you explicitly # enable/disable via the user_mode parameter: $dtc = DateTime::Event::Cron->new(cron => $crontab, user_mode => 1); my $user = $dtc->user; my $command = $dtc->command; # Unparsed original cron entry my $original = $dtc->original; DESCRIPTION
DateTime::Event::Cron generated DateTime events or DateTime::Set objects based on crontab-style entries. METHODS
The cron fields are typical crontab-style entries. For more information, see crontab(5) and extensions described in Set::Crontab. The fields can be passed as a single string or as a reference to an array containing each field. Only the first five fields are retained. DateTime::Set Factories See DateTime::Set for methods provided by Set objects, such as "next()" and "previous()". from_cron($cronline) from_cron(cron => $cronline, %parms, %set_parms) Generates a DateTime::Set recurrence for the cron line provided. See new() for details on %parms. Optionally takes parameters for DateTime::Set. from_crontab(file => $crontab_fh, %parms, %set_parms) Returns a list of DateTime::Set recurrences based on lines from a crontab file. $crontab_fh can be either a filename or filehandle reference. See new() for details on %parm. Optionally takes parameters for DateTime::Set which will be passed along to each set for each line. as_set(%set_parms) Generates a DateTime::Set recurrence from an existing DateTime::Event::Cron object. Constructors new_from_cron(cron => $cronstring, %parms) Returns a DateTime::Event::Cron object based on the cron specification. Optional parameters include the boolean 'user_mode' which indicates that the crontab entry includes a username column before the command. new_from_crontab(file => $fh, %parms) Returns a list of DateTime::Event::Cron objects based on the lines of a crontab file. $fh can be either a filename or a filehandle reference. Optional parameters include the boolean 'user_mode' as mentioned above. Other methods next() next($date) Returns the next valid datetime according to the cron specification. $date defaults to DateTime->now unless provided. previous() previous($date) Returns the previous valid datetime according to the cron specification. $date defaults to DateTime->now unless provided. increment($date) decrement($date) Same as "next()" and "previous()" except that the provided datetime is modified to the new datetime. match($date) Returns whether or not the given datetime (defaults to current time) matches the current cron specification. Dates are truncated to minute resolution. valid($date) A more strict version of match(). Returns whether the given datetime is valid under the current cron specification. Cron dates are only accurate to the minute -- datetimes with seconds greater than 0 are invalid by default. (note: never fear, all methods accepting dates will accept invalid dates -- they will simply be rounded to the next nearest valid date in all cases except this particular method) command() Returns the command string, if any, from the original crontab entry. Currently no expansion is performed such as resolving environment variables, etc. user() Returns the username under which this cron command was to be executed, assuming such a field was present in the original cron entry. original() Returns the original, unparsed cron string including any user or command fields. AUTHOR
Matthew P. Sisk <sisk@mojotoad.com> COPYRIGHT
Copyright (c) 2003 Matthew P. Sisk. All rights reserved. All wrongs revenged. This program is free software; you can distribute it and/or modify it under the same terms as Perl itself. SEE ALSO
DateTime(3), DateTime::Set(3), DateTime::Event::Recurrence(3), DateTime::Event::ICal(3), DateTime::Span(3), Set::Crontab(3), crontab(5) perl v5.14.2 2010-06-10 DateTime::Event::Cron(3pm)
All times are GMT -4. The time now is 09:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy