Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: improve -sdate option #24

Closed
marcodigennaro opened this issue Sep 15, 2023 · 9 comments
Closed

Suggestion: improve -sdate option #24

marcodigennaro opened this issue Sep 15, 2023 · 9 comments

Comments

@marcodigennaro
Copy link
Collaborator

I often need to check all the jobs submitted today, or in the last hour.
I would suggest to insert TODAY as an option and eventually also to set the last hour as default since there is none.

@gpetretto
Copy link
Contributor

By default jf job list should return only the latest 100 jobs according to the last time the job was modified. This can be increased or decreased with the -m option
Other options are available to filter based on time of last modification:

  • jf job list -ds 2
    
    will print the jobs modified in the last two days.
  • jf job list -sdate 2023-09-01 -edate 2023-09-10
    
    will print the jobs last modified from September 1st to 10th. It can also be -sdate 2023-09-05T19:00:00 to specify the time.
    Full list of options with jf job list -h.

Do you think this would be enough? Would it be better to also have a --hours option for jobs modified in the last N hours?

@marcodigennaro
Copy link
Collaborator Author

marcodigennaro commented Sep 15, 2023

jf job list -ds 1 gives back the last 24 hours (so many jobs are from yesterday).
The --hours is a nice idea.
Another alternative would be to specify only the hours in the current -sdate option and allow the %H:%M:%S' format only, with the implicit assumption of %Y-%m-%d' being today

@gpetretto
Copy link
Contributor

Pushed a change that should allow both these options (hours and specify only an hour of the current day): 7bcd12e.
Can you test and let me know if this solves your issue?

@marcodigennaro
Copy link
Collaborator Author

It works! Thanks

@davidwaroquiers
Copy link
Member

Just commenting on this issue, supposing it's 10 past midnight and I put -sdate 23:00:00, it would be nice to show things in the last 1h10m. What do you think ? (so the assumption is not exactly TODAY's date, but last corresponding time in the last 24 hours).

@marcodigennaro
Copy link
Collaborator Author

To my understanding, in your case --hours 2 gives the last 2 hours and -ds 1 gives the last 24 hours.
TODAY is not implemented at this stage, but it is equivalent to -sdate '00:00:00'

@davidwaroquiers
Copy link
Member

Yes I undestood that TODAY's was not implemented. Indeed --hours can be used to see things in the last N hours. I was thinking about -sdate 19:30:00 which would be "last time since last 19h30". I think as it is now, if it is between 19h30 and 23h59, it will work fine, once it is 00h01 (next day), it will return nothing.

@davidwaroquiers
Copy link
Member

Anyway it's just a detail, @gpetretto if you think it's not worth (and/or tedious to implement), just close the issue again :)

@gpetretto
Copy link
Contributor

done in c77029c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants