1

I have a Centos 7 server running in a cloud-server provider (ProfitBricks).

I need to setup a demo system but is really hard to create daily fake data. My idea is to configure this server with an old date ("2016-01-01" as an example).

First problem each time I restart the server the date is updated even though there is no NTP client installed.

Second one, the most important. After I manually change the date using:

$ timedatectl set-time "2016-01-01 12:00:00"

After some minutes I'm not able to see the server (ssh or http). I have restarted the firewalld service and the sshd service, both show status as running.

Any advice?

2
  • 1
    1) traveling backward in time is not a good idea. 2) it looks like system is getting time from a hardware clock, have you try to set it ?
    – Archemar
    Jun 27, 2016 at 11:19
  • two questions, so it should be written as two different U&L questions Jun 27, 2016 at 12:53

2 Answers 2

2

You can fake the time for most applications with the aptly named faketime. Run faketime 'yesterday' myapp to make myapp believe that it's yesterday. Faketime works by intercepting library calls made by the application. It only works with dynamically-linked applications, but that's usually good enough.

Your server is probably taking the time from the hypervisor.

0

If you want files to have a modification date in the past, you can just use the touch command. Depending on what you want to demo, this might already be sufficient. Since your actual requirements are not really clear, it's hard to tell whether changing the system clock with all the associated hassle is a reasonable approach.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .