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


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

Re: How do you use the "at" command?

From Lew Pitcher <lpitcher@teksavvy.com>
Subject Re: How do you use the "at" command?
Newsgroups comp.os.linux.misc
References <jfupll$nq0$1@dont-email.me>
Message-ID <8fCUq.10324$Sh7.9348@newsfe15.iad> (permalink)
Date 2012-01-27 13:43 -0500

Show all headers | View raw


On Friday 27 January 2012 13:16, in comp.os.linux.misc, Todd@invalid.invalid
wrote:

> Hi All,
> 
>     Maybe I am a bit dense here, but the man page for "at"
> is more than a bit confusing to me.
> 
>     What I want to do is run the follow two commands
> as root at a specific time:
> 
>         su root -c "touch /forcefsck; reboot"
> 
>     How do I do that with "at"?

Not easily

Your su command will need access to a tty device (real or pseudo) in order
to acquire root's password. The at(1) command doesn't provide such a file.
This means that your su command will fail or hang, and won't get far enough
to process it's commandline.

Assuming that you remove such password protection around root, then you
could just
  echo 'su root -c "touch /forcefsck; reboot"' | at now + 5 minutes
to have the command executed in five minutes (substitute the appropriate
at(1) options for your intended schedule).

HTH
-- 
Lew Pitcher

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


Thread

How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 10:16 -0800
  Re: How do you use the "at" command? Lew Pitcher <lpitcher@teksavvy.com> - 2012-01-27 13:43 -0500
    Re: How do you use the "at" command? Lew Pitcher <lpitcher@teksavvy.com> - 2012-01-27 13:45 -0500
      Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-27 15:34 -0600
        Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 22:41 -0800
          Re: How do you use the "at" command? Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2012-01-28 10:27 +0000
            Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-01-28 19:05 +0100
              Re: How do you use the "at" command? Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> - 2012-01-28 10:26 -0800
              Re: How do you use the "at" command? Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2012-01-30 08:51 +0000
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-01-31 03:16 +0100
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-02-01 00:24 +0100
                Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-31 17:55 -0600
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-02-01 02:01 +0100
                Re: How do you use the "at" command? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2012-01-31 21:36 -0500
                Re: How do you use the "at" command? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2012-01-31 21:25 -0500
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-02-01 04:57 +0100
                Re: How do you use the "at" command? Darren Salt <news@youmustbejoking.demon.cu.invalid> - 2012-01-31 23:46 +0000
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-02-01 02:12 +0100
  Re: How do you use the "at" command? Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-27 19:10 +0000
    Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 11:17 -0800
      Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-27 15:34 -0600
  Re: How do you use the "at" command? unruh <unruh@invalid.ca> - 2012-01-27 20:26 +0000
    Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 22:51 -0800
  Re: How do you use the "at" command? Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> - 2012-01-27 12:23 -0800
    Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-27 15:35 -0600
      Re: How do you use the "at" command? Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> - 2012-01-27 17:22 -0800
        Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-27 20:25 -0600
          Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 22:49 -0800
            Re: How do you use the "at" command? Bit Twister <BitTwister@mouse-potato.com> - 2012-01-28 07:16 +0000
              Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 23:57 -0800
        Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 22:49 -0800
          Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-28 06:07 -0600
            Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-28 13:32 -0800
              Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-28 22:28 -0600
                Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-28 22:50 -0800
                Re: How do you use the "at" command? Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> - 2012-01-28 23:35 -0800
                Re: How do you use the "at" command? unruh <unruh@invalid.ca> - 2012-01-29 18:46 +0000
                Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-29 12:03 -0800
                Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-29 15:38 -0600
                Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-29 16:58 -0800
                Re: How do you use the "at" command? unruh <unruh@invalid.ca> - 2012-01-30 01:36 +0000
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-01-30 03:07 +0100
                Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-29 19:21 -0800
                Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-29 19:17 -0800
                Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-29 11:48 -0800
                Re: How do you use the "at" command? Robert Heller <heller@deepsoft.com> - 2012-01-29 07:35 -0600
                Re: How do you use the "at" command? Aragorn <stryder@telenet.be.invalid> - 2012-01-29 20:40 +0100
          Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-02-03 13:25 -0800
      Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 22:45 -0800
    Re: How do you use the "at" command? Todd <Todd@invalid.invalid> - 2012-01-27 22:42 -0800

csiph-web