how do I use 'at' or 'crontab -e'

Asked by buzz

Hi All,
               So I read most all the docs on how tos,and a few books,also forum ques/ans, to no avail.
                            I'm just trying to schedule a simple command,to start a game,'blackjack'.
                                  I can go to /usr/games/blackjack hit enter and the program starts,so the command is good.
                                    Using the 'at' command : kaykav@ditty:~$ at now + 5 min
                                                                                        warning: commands will be executed using /bin/sh
                                                                                         at> /usr/games/blackjack
                                                                                          at> <EOT>
                                                                                               job 7 at Sat Nov 7 17:50:00 2009
                                            I check the job with 'atq' kaykav@ditty:~$ atq
                                                                                 Sat Nov 7 17:50:00 2009 a kaykav
                                             But when 17:50 happens,nothing happens.
      When I use crontab -e , again nothing.
                                                          I'm guessing both schedules are not executing for the same reason.
                                                                     What do you think? Thanks......

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu cron Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Qoquaq (qoquaq) said :
#1

try this site to generate your crontab entry

http://www.openjs.com/scripts/jslibrary/demos/crontab.php

this should generate the crotab entry you need. these are not very easy to write until you get the hang of it.

there are also directories which you can place regular scripts in to be run by crond

/etc/cron.weekly
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.daily

this is easier to use than writing your own crontab entries

hope that helps

Revision history for this message
buzz (kav1213) said :
#2

ok I will get busy doing those items......thanks

Revision history for this message
Sam_ (and-sam) said :
#3
Revision history for this message
Sam_ (and-sam) said :
#4
Revision history for this message
buzz (kav1213) said :
#5

OK......... I tried everything. Reviewed all the links. I don't have any problem entering the command ,that's straight enough.
                           It's just not happening. I have three different linux distros on four different computers..Non of them will activate
                                my cron commands. Sometimes assumptions can ruin the day. Is there something I'm doing or not doing
                                     that's preventing success?............Any ideas?............ I even tried the GUI version to no avail.
                                                                                                                                     Thanks

Revision history for this message
Qoquaq (qoquaq) said :
#6

buzz,

cron is used for tasks that you need to be recurring and at a regular interval. is it that you need this task to happen over and over again or just want to delay the running of the task for a specified time frame.

if you need it to be recurring:

i will write a script for you to place in one of the cron directories such that it will be run at a regular interval. when do you want the command to be run and how often?

if you just need a specified delay before which the task is run, i can also write you a script which will accomplish this.

qoquaq

Revision history for this message
buzz (kav1213) said :
#7

Qoquaq,
                          Sounds inviting. My learning process, in linux, is such that I'll try most all applications. Cron usage
                               is just one of the 'let me see if I can do this' tasks. Evidently, and fortunately, I don't truly need to schedule
                                any tasks,although it would be a convenience. In the near future , I'm sure I'll come up with the procedure
                                  to use 'cron or 'at'. Thank you for your attention...........Buzz

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#8
Revision history for this message
Qoquaq (qoquaq) said :
#9

a great at reference for you

http://www.linuxjournal.com/article/4087

there are issues with pam and finding the display which i could not get past. i could not start programs which require x.

errors i get in my auth.log are:

pam_ck_connector(atd:session): cannot determine display-device

messing with pam is beyond me. sorry.

i was able to control system processes with at without an issue.

try:

at now + 2 minutes
pkill < enter a pid which is owned by you >
<ctrl d>

atq will return the schedule for the job

you will find the pid will be gone after the atd has run the job. perhaps you can find other uses now for at. the references provided shows how this was used to kill remote processes after logout.

for the game, write a shell script which takes two arguments:
<the program> and <the delay before it is executed>

if you need help, respond back and i can write it with comments to help you write other scripts

i hope this helps.

Can you help with this problem?

Provide an answer of your own, or ask buzz for more information if necessary.

To post a message you must log in.