Schedule a command to execute minutes later

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












I tried to schedule a command to execute 2 minutes later



at -c "ls -l" now + 2 minutes



It fails with multiple ways



$ echo "open 'Google Chrome' " | at now + 2 minutes
job 15 at Mon Oct 29 13:31:42 2018


How could I enable it working?



run "open 'Google Chrome' " at now + 2 minutes


I tried, it is not working



$ at now 
at>ls -l
at>^D
at> <EOT>

job 18 at Mon Oct 29 15:55:00 2018









share|improve this question









New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • "It fails with multiple ways" - please provide specific errors rather then a general statement.
    – roaima
    2 hours ago










  • Is this on a Mac?
    – roaima
    2 hours ago










  • yes, this is on Mac @roaima
    – Sawajiri
    1 hour ago










  • "it is not working" how do you know it isn't working? What do you think should happen? What did you observe happening? What have you done about the discrepancy to try and resolve it?
    – roaima
    1 hour ago










  • Please do not post duplicates.
    – l0b0
    45 mins ago














up vote
1
down vote

favorite
1












I tried to schedule a command to execute 2 minutes later



at -c "ls -l" now + 2 minutes



It fails with multiple ways



$ echo "open 'Google Chrome' " | at now + 2 minutes
job 15 at Mon Oct 29 13:31:42 2018


How could I enable it working?



run "open 'Google Chrome' " at now + 2 minutes


I tried, it is not working



$ at now 
at>ls -l
at>^D
at> <EOT>

job 18 at Mon Oct 29 15:55:00 2018









share|improve this question









New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • "It fails with multiple ways" - please provide specific errors rather then a general statement.
    – roaima
    2 hours ago










  • Is this on a Mac?
    – roaima
    2 hours ago










  • yes, this is on Mac @roaima
    – Sawajiri
    1 hour ago










  • "it is not working" how do you know it isn't working? What do you think should happen? What did you observe happening? What have you done about the discrepancy to try and resolve it?
    – roaima
    1 hour ago










  • Please do not post duplicates.
    – l0b0
    45 mins ago












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I tried to schedule a command to execute 2 minutes later



at -c "ls -l" now + 2 minutes



It fails with multiple ways



$ echo "open 'Google Chrome' " | at now + 2 minutes
job 15 at Mon Oct 29 13:31:42 2018


How could I enable it working?



run "open 'Google Chrome' " at now + 2 minutes


I tried, it is not working



$ at now 
at>ls -l
at>^D
at> <EOT>

job 18 at Mon Oct 29 15:55:00 2018









share|improve this question









New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I tried to schedule a command to execute 2 minutes later



at -c "ls -l" now + 2 minutes



It fails with multiple ways



$ echo "open 'Google Chrome' " | at now + 2 minutes
job 15 at Mon Oct 29 13:31:42 2018


How could I enable it working?



run "open 'Google Chrome' " at now + 2 minutes


I tried, it is not working



$ at now 
at>ls -l
at>^D
at> <EOT>

job 18 at Mon Oct 29 15:55:00 2018






bash osx






share|improve this question









New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 36 mins ago









fpmurphy1

2,301915




2,301915






New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









Sawajiri

165




165




New contributor




Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Sawajiri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • "It fails with multiple ways" - please provide specific errors rather then a general statement.
    – roaima
    2 hours ago










  • Is this on a Mac?
    – roaima
    2 hours ago










  • yes, this is on Mac @roaima
    – Sawajiri
    1 hour ago










  • "it is not working" how do you know it isn't working? What do you think should happen? What did you observe happening? What have you done about the discrepancy to try and resolve it?
    – roaima
    1 hour ago










  • Please do not post duplicates.
    – l0b0
    45 mins ago
















  • "It fails with multiple ways" - please provide specific errors rather then a general statement.
    – roaima
    2 hours ago










  • Is this on a Mac?
    – roaima
    2 hours ago










  • yes, this is on Mac @roaima
    – Sawajiri
    1 hour ago










  • "it is not working" how do you know it isn't working? What do you think should happen? What did you observe happening? What have you done about the discrepancy to try and resolve it?
    – roaima
    1 hour ago










  • Please do not post duplicates.
    – l0b0
    45 mins ago















"It fails with multiple ways" - please provide specific errors rather then a general statement.
– roaima
2 hours ago




"It fails with multiple ways" - please provide specific errors rather then a general statement.
– roaima
2 hours ago












Is this on a Mac?
– roaima
2 hours ago




Is this on a Mac?
– roaima
2 hours ago












yes, this is on Mac @roaima
– Sawajiri
1 hour ago




yes, this is on Mac @roaima
– Sawajiri
1 hour ago












"it is not working" how do you know it isn't working? What do you think should happen? What did you observe happening? What have you done about the discrepancy to try and resolve it?
– roaima
1 hour ago




"it is not working" how do you know it isn't working? What do you think should happen? What did you observe happening? What have you done about the discrepancy to try and resolve it?
– roaima
1 hour ago












Please do not post duplicates.
– l0b0
45 mins ago




Please do not post duplicates.
– l0b0
45 mins ago










1 Answer
1






active

oldest

votes

















up vote
2
down vote













You misunderstand what the -c option does. This option prints out the contents of the temporary file which is created by the at command when a new at job is created.



Here is one way to create a simple at job:



$ at now + 2 minutes
at> ls -l
at> CTRL-D <---- Press Control Key + D Key simultaniously
at> <EOT>
job 2 at Mon Oct 29 03:34:00 2018
$


And here is the contents of the temporary file created by at for thie job:



$ at -c 2
#!/bin/sh
# atrun uid=1000 gid=1000
# mail student 0
umask 2
XDG_VTNR=1; export XDG_VTNR
SSH_AGENT_PID=3010; export SSH_AGENT_PID
XDG_SESSION_ID=1; export XDG_SESSION_ID
.... lots more environment ....
cd /home/student ||
echo 'Execution directory inaccessible' >&2
exit 1

$SHELL:-/bin/sh << 'marcinDELIMITER689a131f'
ls -l

marcinDELIMITER689a131f
$





share|improve this answer




















  • ty, I tried but not works as intended.
    – Sawajiri
    1 hour ago










  • @Sawajiri then please edit your question to tell us what you intend.
    – roaima
    1 hour ago










  • @Sawajiri. Exactly what did not work in the able example?
    – fpmurphy1
    40 mins ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Sawajiri is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478348%2fschedule-a-command-to-execute-minutes-later%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













You misunderstand what the -c option does. This option prints out the contents of the temporary file which is created by the at command when a new at job is created.



Here is one way to create a simple at job:



$ at now + 2 minutes
at> ls -l
at> CTRL-D <---- Press Control Key + D Key simultaniously
at> <EOT>
job 2 at Mon Oct 29 03:34:00 2018
$


And here is the contents of the temporary file created by at for thie job:



$ at -c 2
#!/bin/sh
# atrun uid=1000 gid=1000
# mail student 0
umask 2
XDG_VTNR=1; export XDG_VTNR
SSH_AGENT_PID=3010; export SSH_AGENT_PID
XDG_SESSION_ID=1; export XDG_SESSION_ID
.... lots more environment ....
cd /home/student ||
echo 'Execution directory inaccessible' >&2
exit 1

$SHELL:-/bin/sh << 'marcinDELIMITER689a131f'
ls -l

marcinDELIMITER689a131f
$





share|improve this answer




















  • ty, I tried but not works as intended.
    – Sawajiri
    1 hour ago










  • @Sawajiri then please edit your question to tell us what you intend.
    – roaima
    1 hour ago










  • @Sawajiri. Exactly what did not work in the able example?
    – fpmurphy1
    40 mins ago














up vote
2
down vote













You misunderstand what the -c option does. This option prints out the contents of the temporary file which is created by the at command when a new at job is created.



Here is one way to create a simple at job:



$ at now + 2 minutes
at> ls -l
at> CTRL-D <---- Press Control Key + D Key simultaniously
at> <EOT>
job 2 at Mon Oct 29 03:34:00 2018
$


And here is the contents of the temporary file created by at for thie job:



$ at -c 2
#!/bin/sh
# atrun uid=1000 gid=1000
# mail student 0
umask 2
XDG_VTNR=1; export XDG_VTNR
SSH_AGENT_PID=3010; export SSH_AGENT_PID
XDG_SESSION_ID=1; export XDG_SESSION_ID
.... lots more environment ....
cd /home/student ||
echo 'Execution directory inaccessible' >&2
exit 1

$SHELL:-/bin/sh << 'marcinDELIMITER689a131f'
ls -l

marcinDELIMITER689a131f
$





share|improve this answer




















  • ty, I tried but not works as intended.
    – Sawajiri
    1 hour ago










  • @Sawajiri then please edit your question to tell us what you intend.
    – roaima
    1 hour ago










  • @Sawajiri. Exactly what did not work in the able example?
    – fpmurphy1
    40 mins ago












up vote
2
down vote










up vote
2
down vote









You misunderstand what the -c option does. This option prints out the contents of the temporary file which is created by the at command when a new at job is created.



Here is one way to create a simple at job:



$ at now + 2 minutes
at> ls -l
at> CTRL-D <---- Press Control Key + D Key simultaniously
at> <EOT>
job 2 at Mon Oct 29 03:34:00 2018
$


And here is the contents of the temporary file created by at for thie job:



$ at -c 2
#!/bin/sh
# atrun uid=1000 gid=1000
# mail student 0
umask 2
XDG_VTNR=1; export XDG_VTNR
SSH_AGENT_PID=3010; export SSH_AGENT_PID
XDG_SESSION_ID=1; export XDG_SESSION_ID
.... lots more environment ....
cd /home/student ||
echo 'Execution directory inaccessible' >&2
exit 1

$SHELL:-/bin/sh << 'marcinDELIMITER689a131f'
ls -l

marcinDELIMITER689a131f
$





share|improve this answer












You misunderstand what the -c option does. This option prints out the contents of the temporary file which is created by the at command when a new at job is created.



Here is one way to create a simple at job:



$ at now + 2 minutes
at> ls -l
at> CTRL-D <---- Press Control Key + D Key simultaniously
at> <EOT>
job 2 at Mon Oct 29 03:34:00 2018
$


And here is the contents of the temporary file created by at for thie job:



$ at -c 2
#!/bin/sh
# atrun uid=1000 gid=1000
# mail student 0
umask 2
XDG_VTNR=1; export XDG_VTNR
SSH_AGENT_PID=3010; export SSH_AGENT_PID
XDG_SESSION_ID=1; export XDG_SESSION_ID
.... lots more environment ....
cd /home/student ||
echo 'Execution directory inaccessible' >&2
exit 1

$SHELL:-/bin/sh << 'marcinDELIMITER689a131f'
ls -l

marcinDELIMITER689a131f
$






share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









fpmurphy1

2,301915




2,301915











  • ty, I tried but not works as intended.
    – Sawajiri
    1 hour ago










  • @Sawajiri then please edit your question to tell us what you intend.
    – roaima
    1 hour ago










  • @Sawajiri. Exactly what did not work in the able example?
    – fpmurphy1
    40 mins ago
















  • ty, I tried but not works as intended.
    – Sawajiri
    1 hour ago










  • @Sawajiri then please edit your question to tell us what you intend.
    – roaima
    1 hour ago










  • @Sawajiri. Exactly what did not work in the able example?
    – fpmurphy1
    40 mins ago















ty, I tried but not works as intended.
– Sawajiri
1 hour ago




ty, I tried but not works as intended.
– Sawajiri
1 hour ago












@Sawajiri then please edit your question to tell us what you intend.
– roaima
1 hour ago




@Sawajiri then please edit your question to tell us what you intend.
– roaima
1 hour ago












@Sawajiri. Exactly what did not work in the able example?
– fpmurphy1
40 mins ago




@Sawajiri. Exactly what did not work in the able example?
– fpmurphy1
40 mins ago










Sawajiri is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















Sawajiri is a new contributor. Be nice, and check out our Code of Conduct.












Sawajiri is a new contributor. Be nice, and check out our Code of Conduct.











Sawajiri is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478348%2fschedule-a-command-to-execute-minutes-later%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

Confectionery