Reputation: 1
I want to run command with specific date in history. Let say today is 12.Nov.2019 and I need to run one command with date of 10th. Is there any possibility of setting date on fly ?
date -d '1 day ago' /path/to/command
doesn't work.
Upvotes: 0
Views: 938
Reputation: 83
Use can you faketime
to run a command with given time:
faketime - manipulate the system time for a given command
Because you didn't tell us what command and time you want to run,
I suppose that you want to run /path/to/command
on Oct 10th, 2019
.
/path/to/command
in 2 days ago:faketime -f -2d /path/to/command
/path/to/command
on Oct 10th, 2019:faketime -f '2019-11-10' /path/to/command
Upvotes: 3