0

I desire to run a particular task 2 hours ahead from now.

In Bash 4.3 in Ubuntu 16.04 I executed:

tdm() {
    chmod -R a-x,a=rX,u+w "$drt"/phpmyadmin/
    echo "chmod -R 000 "$drt"/phpmyadmin/" | at +2h
}
tdm

I get:

syntax error. Last token seen: +

Garbled time

Maybe I should put current time in a variable X somehow and define "at 2 hours from time X"?

I didn't understand the answer here.

1 Answer 1

3

According to the at manual on Ubuntu, the format of the time specification can be on the form

now + count time-units, where the time-units can be minutes, hours, days, or weeks

This means that you should use

at now + 2 hours

to execute the command "in two hours time from now".

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.