How to script at job creation?

Bo Berglund bo.berglund at gmail.com
Thu Dec 10 10:18:52 UTC 2020


I am running an Ubuntu 18.04 LTS server where I want to have some
commands run at specific times. So I have used at to create them
interactively inside a terminal window. The number of jobs each day is
12 or more and they are all very similar but not identical.

So now I am repeating the same chore every day over and over and it
feels like hacking away at the keyboard is not productive, so I wonder
if there is some way to *script* the creation of at jobs?

I need at rather than cron because the at job creation saves the user
and the current dir and it seems like also the user environment at the
time of creation.
So the job will run just like I was inside the target dir and executed
the job on the terminal command line.

With cron it gets much more complex...

The jobs I want to run call my scripts (located in $USER/bin) so this
must work, and it does when I create the jobs manually.

So I would like to create a script I can run in the target dir and it
will create the 12 different at jobs in one command execution.

Can this be done at all?


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list