PLEASE NOTE: the upgrades to this server, secure.csse.uwa.edu.au, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Displaying the 10 articles in this topic
Showing 10 of 919 articles.
Currently 3 other people reading this forum.


 UWA week 34 (2nd semester, week 5) ↓
SVG not supported

Login to reply

👍?
helpful
11:34am Mon 22nd Aug, Matthew C.

For the requirement to check for errors in the crontab-file and the estimate-file, are we guaranteed that "The crontab-file and the estimates-file will each contain at most 20 non-comment lines. Each line will be at most 100 characters long, and each command name will be at most 40 characters long." are true? Are the "errors" we are checking for just whether or not each line conforms with the stated formatting?


SVG not supported

Login to reply

👍?
helpful
11:46am Mon 22nd Aug, Christopher M.

The files will not exceed the stated dimensions (number of lines, and width) - there is no need to check those. But you will need to check the format of non-comment lines, and the data itself.


SVG not supported

Login to reply

👍?
helpful
11:55am Mon 22nd Aug, Matthew C.

By "the data itself" this includes that if it specifies the day of the month as a date, that there are enough days in the month (not worrying about leap years)? what is the behaviour if a day of the month and a day of the week is specified? does that mean for example, the command will run every monday of the month as well as the first of each month?


SVG not supported

Login to reply

👍?
helpful
12:12pm Mon 22nd Aug, Christopher M.

"Matthew Carlsen" <23*8*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> By "the data itself" this includes that if it specifies the day of the month as a date, that there are enough days in the month (not worrying about leap years)?
(politely) this is something you should be able to reason about for yourself.
> what is the behaviour if a day of the month and a day of the week is specified? does that mean for example, the command will run every monday of the month as well as the first of each month?
You will need to handle contradictory data (as an error).


SVG not supported

Login to reply

👍x1
helpful
1:39pm Mon 22nd Aug, Matthew C.

(politely) it is not obvious if this is contradictory. It could mean run only when the day of the month matches the day of the week in a given month, (which would be kind of obtuse imo), or it could mean run on every monday and run on every 13th of the month.


SVG not supported

Login to reply

👍x1
helpful
4:14am Tue 23rd Aug, Christopher M.

"Matthew Carlsen" <23*8*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> (politely) it is not obvious if this is contradictory. > It could mean run only when the day of the month matches the day of the week in a given month, > (which would be kind of obtuse imo), or it could mean run on every monday and run on every 13th of the month.
Hi Matthew, sorry, 'contradictory' was the wrong word. Using today's date, Tue 23rd August (2022): 1 1 23 7 2 - applies in 2022 (the 2 looks redundant but it documents the requirement) 1 1 23 7 tue - applies in 2022 (the tue looks redundant but it documents the requirement) 1 1 23 7 wed - all fields are valid values, but the command would not run in 2022 1 1 23 7 * - applies in any year 1 1 * 7 tue - applies in any year, and includes 23 Aug as one of the 5 Tuesdays in August 2022 Is that now clearer? I've added it to our Clarifications page.


SVG not supported

Login to reply

👍?
helpful
10:00am Wed 24th Aug, Ryan W.

If the month is not specified, but the day of the week is, can the day of the month be specified?

For instance:

* * 1 * mon foo

I intepret this as valid and meaning:

"run foo on every minute of every hour on the first day of each month if it's a monday"

but I'm not sure.

Also can the same command be on multiple non-comment lines

* * 1 jan * foo
* * 2 jan * foo

In which case it means "run foo every minute of every hour on both the 1st and 2nd day of January".

Sorry if you've already answered this


SVG not supported

Login to reply

👍?
helpful
10:19am Wed 24th Aug, Alicia L.

Hello Chris, adding on to the question recently asked by Ryan, I would like to know if you expect our program to check the calendar for valid dates.

I'm concerned about this because of the asterisk, which basically takes in all the possible values of a month. So for the example given by Ryan, the program would assume that every month starts on Monday as its first day, where foo will be run.

So want to have a clarification that if you do expect us to implement a calendar system for this year, then the example would be an invalid time. Otherwise no

Thanks in advance :)


SVG not supported

Login to reply

👍?
helpful
10:54am Wed 24th Aug, Christopher M.

"Ryan White" [email protected] wrote:

* * 1 * mon foo

"run foo on every minute of every hour on the first day of each month if it's a monday"

Yes, that's how I interpret it. I think about the asterisks as wildcards, and effectively ignoring them, so the above matches any minute/hour/month when the 1st of the month is also a Monday.

Unsure if the Clarifications page also answers this question for you.

Also can the same command be on multiple non-comment lines

* * 1 jan * foo
* * 2 jan * foo

Yes, certainly. With our simplified format, this is the only way to indicate multiple values, without using an asterisk.

Actual implementations of cron support many easy-to-use-but-difficult-to-parse values such as "1,2" or "5-9", but supporting those would make our project far too difficult.


SVG not supported

Login to reply

👍?
helpful
10:58am Wed 24th Aug, Christopher M.

Hi Alicia,

"Alicia Lau" [email protected] wrote:

adding on to the question recently asked by Ryan, I would like to know if you expect our program to check the calendar for valid dates.

Yes. A pattern such as 1 1 32 7 * is invalid because there are only 31 days in August.

I'm concerned about this because of the asterisk, which basically takes in all the possible values of a month. So for the example given by Ryan, the program would assume that every month starts on Monday as its first day, where foo will be run.

Yes, but the asterisk cannot every represent the 32, because it's not part of a valid date.

So want to have a clarification that if you do expect us to implement a calendar system for this year, then the example would be an invalid time. Otherwise no

It's not really a 'calendar system', and you don't need to 'do it all yourself', as we've already seen something helpful in a class session (big hint :-).

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy