Github Action won't allow cron starting in custom year period - github

The following cron expression:
0 3 1 5-5/3 *
“At 03:00 on day-of-month 1 in every 3rd month from May through May.”
Is not accepted by Github actions:
on:
schedule:
- cron: "0 3 1 5-5/3 *" ## Day 1, every 3rd month May-May
With the following output:
ERROR: String does not match the pattern of "^(((\d+,)+\d+|((\d+|\*)/\d+|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))|(\d+-\d+)|\d+|\*|((MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?)) ?){5}$".yaml-schema: GitHub Workflow
How is it possible to run a cron starting 1st of May, every 3 months, until the next May?

Your cron expression probably does not what you expect. The part 5-5/3 restricts the execution times to May only. This results in a job that will be run at 03:00 on the first day of every May:
2022-05-01 03:00:00
2023-05-01 03:00:00
2024-05-01 03:00:00
The regex that GitHub is using to verify the cron expression (according to the error message in your question) does not allow defining a range and step at the same time. This might be a bug as such expressions would usually be valid.
To fix this, you could list all months in the cron expression directly like 0 3 1 5,8,11,2 * which results in the following schedule:
2022-05-01 03:00:00
2022-08-01 03:00:00
2022-11-01 03:00:00
2023-02-01 03:00:00
2023-05-01 03:00:00
2023-08-01 03:00:00
2023-11-01 03:00:00
2024-02-01 03:00:00

Related

Can't See Timeline View in org-agenda

I type M-x org-agenda in org-mode, the list of commands shows, I press a, the agenda buffer opens but only shows the dates, and pressing L won't expand:-
Week-agenda (W27):
Monday 1 July 2019 W27
Tuesday 2 July 2019
Wednesday 3 July 2019
Thursday 4 July 2019
Friday 5 July 2019
Saturday 6 July 2019
Sunday 7 July 2019
================================================================
Global list of TODO items of type: ALL
I am seeing the same problem with emacs 24, 25, 26 on Win 7. The same file shows detailed timelines fine on a debian machine.
As reported in a now deleted comment, timeline view is no more (org-mode version 9.1 onwards). See https://www.orgmode.org/Changes_old.html

emacs org-agenda - missing all the daily details for tasks

For emacs25 (emacs 25.2.2 on ubuntu 17.10), I am not able to get org-agenda-list working. org-timeline shows me details on a daily basis, but org-agenda-list just lists the names of the days and there are no details listed.
I have the following .emacs (simplified down to one line to track down why org-agenda is not working - I know emacs reasonably well, but I am a first time user of org-mode)
(global-set-key "\C-ca" 'org-agenda)
and with an empty .emacs.d directory, when I run org-agenda-list for the following example:
* Tasks
** DONE [#A] do this y'day
SCHEDULED: <2018-03-22 Thu>
** TODO [#A] do this tomorrow
SCHEDULED: <2018-03-24 Sat>
** TODO [#A] this task is not scheduled
** TODO [#B] scheduled for today, priority B
SCHEDULED: <2018-03-23 Fri>
** IN PROGRESS [#A] scheduled today and deadline in 2 days
DEADLINE: <2018-03-25 Sun> SCHEDULED: <2018-03-23 Fri>
** TODO [#A] deadline in 2 days and not scheduled
DEADLINE: <2018-03-25 Sun>
** TODO [#A] scheduled for monday
SCHEDULED: <2018-03-29 Thu>
** TODO [#C] do this today if I get time
SCHEDULED: <2018-03-23 Fri>
** TODO [#B] neither is this one
** TODO [#C] or this one
** TODO [#A] deadline in 10 days and not scheduled
DEADLINE: <2018-03-31 Sat>
I only see the week entries and it is missing all the details for the daily tasks
Week-agenda (W12):
Monday 19 March 2018 W12
Tuesday 20 March 2018
Wednesday 21 March 2018
Thursday 22 March 2018
Friday 23 March 2018
Saturday 24 March 2018
Sunday 25 March 2018
Where as org-timeline shows me the details for the daily tasks
Thursday 22 March 2018
Scheduled: DONE [#A] do this y'day
-------------------------------------------------------------------------------
Friday 23 March 2018
Scheduled: IN PROGRESS [#A] scheduled today and deadline in 2 days
Scheduled: TODO [#B] scheduled for today, priority B
Scheduled: TODO [#C] do this today if I get time
Saturday 24 March 2018
Scheduled: TODO [#A] do this tomorrow
Sunday 25 March 2018
Deadline: IN PROGRESS [#A] scheduled today and deadline in 2 days
Deadline: TODO [#A] deadline in 2 days and not scheduled
[... 4 empty days omitted]
Thursday 29 March 2018
Scheduled: TODO [#A] scheduled for monday
Friday 30 March 2018
Saturday 31 March 2018
Deadline: TODO [#A] deadline in 10 days and not scheduled
Q: How do I get org-agenda-list to work properly for me ?
Moreover after I installed
M-x package-install org-edna
based on some online advice, I also lost the org-timeline command, which I recovered via brute-force application of "apt remove emacs" and "apt install emacs".
Q: Can anyone explain to me why I had lost the org-timeline command ?
Thanks.
Check : C-h v org-agenda-files. If your file is not there then, while your file is opened in the buffer, use M-x org-agenda-file-to-front. Now try M-x org-agenda. You can check C-h v org-agenda-files again and you will find your file there.

crontab executing hour apart , both set to BST: 2 servers. Why?

I've just moved servers and have overlap on crontabs running.
Both servers set to BST, but one sends me a log at
08:00 BST the other old one 09:00 BST
The crontab entry for both is
0 9 * * * /root/phpmaillog.sh > /dev/null 2>&1
Mystery?

Perl created files with future timestamps on FreeBSD 9.3

I just encountered some strange behavior with Perl 5.16.3 on FreeBSD 9.3-RELEASE-p3. We've got a cron job which runs every five minutes and generates some text status files. I just happened to list the contents of the output directory and saw that the timestamps for some of the files were in the future! The files are created like this:
if (open(OUT, "> $status_file_path")) {
print OUT "$status_info\n";
close OUT;
}
Now, the file handle OUT is used in several places, however it is opened and closed within the same block as shown above. And like I said, out of ten files, only a few had future dates when displayed using ls.
For example, files with the current date had timestamps like 04/02/2015 20:29:46, files with future timestamps were out in November, e.g. 11/10/2015 09:38:41.
What might be going on here?
EDIT
I've got two tests running:
1) a perl script running a loop of 1000 iterations, sleeping a random time up to 10 seconds between iterations, using the open/print/close logic to create an output file and abort the script if the file's modification time is in the future.
2) a cron entry to touch a test file every minute, e.g. touch /home/test/test_file_date_with_cron.txt
TEST RESULTS
Neither of the tests generated output files with a timestamp in the future.
This is scary.
EDIT 2
Here is the filesystem info, the files are written in the /usr directory.
# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/gpt/gprootfs 2G 133M 1.7G 7% /
devfs 1.0k 1.0k 0B 100% /dev
/dev/gpt/gpusrfs 431G 3.8G 392G 1% /usr
procfs 4.0k 4.0k 0B 100% /proc
EDIT 3
Running the script outside of cron for several hundred iterations didn't duplicate the problem. HOWEVER, I just found some other files, which are created by a CGI script which have the future dates:
-rw-r--r-- 1 test test 5783 Nov 10 2015 Config.xml_20150210_104151
-rw-r--r-- 1 test test 34548 Nov 10 2015 Config2.xml_20150210_104151
-rw-r--r-- 1 test test 6105 Nov 10 2015 Config.xml_20151109_232210
-rw-r--r-- 1 test test 34554 Nov 10 2015 Config2.xml_20151109_232210
-rw-rw-r-- 1 root test 2075 Nov 9 2015 Config.xml_20151109_231055
-rw-rw-r-- 1 root test 1232 Nov 9 2015 Config2.xml_20151109_231055
These are archive files, which get moved and renamed with the file's mtime timestamp. Note that BOTH ls and Perl's stat() function report the future date -- stat() is used to generate the file's timestamp portion of the name.
Looking at the first entry, ls reports "Nov 10 2015", whereas when the CGI script processed it, Perl's stat() reported "20150210_104151", i.e. "Feb 02 2015" which is most likely correct.
Further down, we see ls showing "Nov 10 2015" and stat() reported "20151109_232210", i.e. "Nov 09 2015".
Finding those additional archived config files helped me track down the cause, which was as others have suggested, that the system date and timezone changed.
From: 1447147328 and America/Adak
To: 1426637771 and America/New_York
What was throwing me off, was that I thought the cron script wrote ALL of the output files each time it executes, but that's not the case. The files have different "refresh intervals".

What other repository systems have cvs's -D (date) option?

I recently stumbled upon a cool feature in CVS where you can name revisions by date, e.g.:
# List changes made between the latest revision 24 hours ago and now
cvs diff -D "1 day ago"
Do any other repository systems (e.g. Git, SVN, Bazaar, Mercurial, etc.) have an option like this?
Subversion has a similar feature. For example:
svn diff -r {2010-07-31}
The syntax is explained in http://svnbook.red-bean.com/en/1.5/svn.tour.revs.specifiers.html#svn.tour.revs.dates
Mercurial has a wide range of date formats: http://www.selenic.com/mercurial/hg.1.html#date-formats, though maybe not "1 day ago".
This subversion bug report indicates that Subversion can't do it natively, but does offer a tip on using date to do it:
(2) Whilst Subversion doesn't understand -r "{3 days ago}", date can
help out there too: -r "{date -Is -d '3 days ago'}".
(answering my own question)
git log supports dates for filtering before or after given times. Example:
git log --after='july 17 2010' --before='july 31 2010'
Here's a shell script that makes it a little easier to list ranges of commits, but it also uses a terser format than git log's default:
#!/bin/sh
# git-changes
FORMAT='%cd%x09%h%n%x09%s%n'
CMD="git log --format=format:$FORMAT"
case $# in
0 )
$CMD ;;
1 )
$CMD "--after=`date -d "$1"`" ;;
2 )
$CMD "--after=`date -d "$1"`" --before="`date -d "$2"`";;
esac
Note: I wrapped the date arguments with the date command, since git treats 'July 17' as a few hours off from 'July 17 2010' for some reason.
Usage:
git-changes # Same as git log, but more terse
git-changes 'yesterday' # List all commits from 24 hours ago to now
git-changes 'jul 17' 'aug 1' # List all commits after July 17 at midnight
# and before August 1 at midnight.
Sample output of git-changes 'jul 17' 'aug 1':
Sat Jul 31 23:43:47 2010 -0400 86a6727
* Moved libcurl into project directory as static lib.
Sat Jul 31 20:04:24 2010 -0400 3a4eb10
* Added configuration file support.
Sat Jul 31 17:44:53 2010 -0400 aa2046b
* Fixed truncation bug in bit parser.
Sat Jul 17 00:10:57 2010 -0400 99e8124
* Added support for more bits.
Now, to see all changes introduced by commit 99e8124, type git show 99e8124. To see all changes since revision 99e8124 (not including that commit itself), type git diff 99e8124.