0

I found some examples here: http://www.thegeekstuff.com/2010/06/at-atq-atrm-batch-command-examples

But how can I create at job with specific time that contains minutes, seconds and even year, like 2018-01-15 08:00:00? What is the format of input date/time?

2 Answers 2

3

One concrete example:

$ at 4pm + 5 days
warning: commands will be executed using /bin/sh
at> true
at> <EOT>  # ctrl+d
job 1 at Thu May  4 16:00:00 2023

With a specific date/hour:

$ at 4pm 050423 
warning: commands will be executed using /bin/sh
at> true
at> <EOT>
job 3 at Thu May  4 16:00:00 2023
-1

Have you ever tried to read the manual page?

man at:

   At allows fairly complex time  specifications,  extending  the  POSIX.2
   standard.   It  accepts  times of the form HH:MM to run a job at a spe‐
   cific time of day.  (If that time is already  past,  the  next  day  is
   assumed.)   You  may  also specify midnight, noon, or teatime (4pm) and
   you can have a time-of-day suffixed with AM or PM for  running  in  the
   morning or the evening.  You can also say what day the job will be run,
   by giving a date in the form month-name day with an optional  year,  or
   giving  a  date  of  the form MMDD[CC]YY, MM/DD/[CC]YY, DD.MM.[CC]YY or
   [CC]YY-MM-DD.  The specification of a date must follow  the  specifica‐
   tion  of  the  time  of  day.  You can also give times like now + count
   time-units, where the time-units can be minutes, hours, days, or  weeks
   and  you  can  tell  at to run the job today by suffixing the time with
   today and to run the job tomorrow by suffixing the time with tomorrow.

   For example, to run a job at 4pm three days from now, you would  do  at
   4pm  + 3 days, to run a job at 10:00am on July 31, you would do at 10am
   Jul 31 and to run a job at 1am tomorrow, you would do at 1am tomorrow.

   The  definition  of  the   time   specification   can   be   found   in
   /usr/share/doc/at/timespec.
1
  • Yes I did read it and have to say it's an example of how manual page shouldn't look like. It's a single man page for like 6 different commands, with about 0 examples whatsoever.
    – Petr
    Commented Dec 18, 2017 at 23:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .