
On Thu, 2022-11-24 at 07:43 +0000, c.buhtz@posteo.jp wrote:
faketime -d "12:00" -c crond --restart
Very good idea and I am just testing this! My Ubuntu 20.04 does not know the "-d" and "-c" options, do you use another version? I can run it without that but what is the meaning of these options? --- $ faketime --help Usage: faketime [switches] <timestamp> <program with arguments> This will run the specified 'program' with the given 'arguments'. The program will be tricked into seeing the given 'timestamp' as its starting date and time. The clock will continue to run from this timestamp. Please see the manpage (man faketime) for advanced options, such as stopping the wall clock and make it run faster or slower. The optional switches are: -m : Use the multi-threaded version of libfaketime -f : Use the advanced timestamp specification format (see manpage) --exclude-monotonic : Prevent monotonic clock from drifting (not the raw monotonic one) Examples: faketime 'last friday 5 pm' /bin/date faketime '2008-12-24 08:15:42' /bin/date faketime -f '+2,5y x10,0' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done' faketime -f '+2,5y x0,50' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done' faketime -f '+2,5y i2,0' /bin/bash -c 'date; while true; do date; sleep 1 ; done' In this single case all spawned processes will use the same global clock without restarting it at the start of each process. (Please note that it depends on your locale settings whether . or , has to be used for fractions)