Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #1301

Re: at syntax

From General Schvantzkoph <schvantzkoph@yahoo.com>
Newsgroups comp.os.linux.misc
Subject Re: at syntax
Date 2011-06-01 02:50 +0000
Message-ID <94lnoaF7lqU3@mid.individual.net> (permalink)
References <94i4ppF634U1@mid.individual.net> <is46v2$k2d$1@dont-email.me>

Show all headers | View raw


On Wed, 01 Jun 2011 02:08:34 +0000, Kevin Snodgrass wrote:

> On Mon, 30 May 2011 18:08:58 +0000, General Schvantzkoph wrote:
> 
>> at adds a week to a day if the day is today. To clarify if today is
>> Monday and I schedule something as
>> 
>> at 10:00 PM MON < foo
>> 
>> it will execute foo a week from today rather than tonight. I'm using
>> scripts to schedule events so I don't want to us TODAY to specify the
>> date, I want to use the generic day of the week. Is there a way to make
>> at schedule an event on the same day or do I have to put a date test
>> into the script?
> 
> Not sure *exactly* what you are trying to accomplish, but I do something
> similar.  I record some things, 5 days a week, every week.  I have a
> script that does this with /usr/bin/at, it looks something like this:
> 
> $ cat ~/bin/weekly.sh
> #!/bin/bash
> 
> BINDIR=$HOME/bin
> ATCMD="at -q l"
> 
> $ATCMD -f $BINDIR/Leno0_1.0.sh       10:33PM  monday $ATCMD -f
> $BINDIR/Leno0_1.0.sh       10:33PM  tuesday $ATCMD -f
> $BINDIR/Leno0_1.0.sh       10:33PM  wednesday $ATCMD -f
> $BINDIR/Leno0_1.0.sh       10:33PM  thursday $ATCMD -f
> $BINDIR/Leno0_1.0.sh       10:33PM  friday
> 
> ...etc...
> ---end---
> 
> It's actually more complex, but you get the idea.
> 
> The at command has multiple queues, thus the "at -q l" command.  Then I
> can query whether the recordings are properly set with "atq -q l" for
> this particular set of recordings, and not see the other several dozen
> commands I have queued up.
> 
> The actual recording logic is setup in $HOME/bin/Leno0_1.0.sh.  I use
> this naming convention to specify the recording device (0), and the
> length in hours (1.0).  Some other things that I record may have varying
> lengths or may be scheduled for other recording devices.  It gets
> complicated. :-)
> 
> You could have a line at the end of the above to reload itself to run
> next week, thus self perpetuation.  At the end, a line similar to this:
> 
> at -f $HOME/bin/weekly.sh 1:00PM sunday
> 
> Since it would be slightly later than 1PM by the time it gets to this
> last line, it will be scheduled to run next sunday.  You might even put
> in a "sleep 5" or some such just to make sure.
> 
> Does that help you out, General?

I already have the automatic reload in my script, I have the schedule 
script reschedule itself every week

at now + 1 week < /usr/local/csh/schedule_tv

Using multiple queues is a good idea, thanks I'll add that. It sounds like 
I'll just have to use my wrapper script to solve the same day problem.

I have another question. Is there a switch to get atq to give you details 
of the scheduled job?




Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

at syntax General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-05-30 18:08 +0000
  Re: at syntax Lew Pitcher <lpitcher@teksavvy.com> - 2011-05-30 16:04 -0400
    Re: at syntax General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-05-30 23:16 +0000
  Re: at syntax Chris Davies <chris-usenet@roaima.co.uk> - 2011-05-31 09:44 +0100
    Re: at syntax General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-05-31 12:37 +0000
      Re: at syntax Chris Davies <chris-usenet@roaima.co.uk> - 2011-05-31 14:54 +0100
        Re: at syntax General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-05-31 18:52 +0000
          Re: at syntax Chris Davies <chris-usenet@roaima.co.uk> - 2011-06-02 21:03 +0100
            Re: at syntax dave.gma+news002@googlemail.com.invalid (Dave Gibson) - 2011-06-02 22:24 +0100
              Re: at syntax Chris Davies <chris-usenet@roaima.co.uk> - 2011-06-03 09:34 +0100
                Re: at syntax General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-06-03 13:21 +0000
                Re: at syntax Chris Davies <chris-usenet@roaima.co.uk> - 2011-06-03 15:46 +0100
  Re: at syntax Kevin Snodgrass <kdsnodgrass@yahoo.com> - 2011-06-01 02:08 +0000
    Re: at syntax General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-06-01 02:50 +0000
      Re: at syntax Kevin Snodgrass <kdsnodgrass@yahoo.com> - 2011-06-01 04:30 +0000
      Re: at syntax Kevin Snodgrass <kdsnodgrass@yahoo.com> - 2011-06-01 04:31 +0000
      Re: at syntax Kevin Snodgrass <kdsnodgrass@yahoo.com> - 2011-06-01 04:31 +0000
      Re: at syntax Kevin Snodgrass <kdsnodgrass@yahoo.com> - 2011-06-01 04:30 +0000

csiph-web