Questions tagged [date]
154 questions
1
vote
4 answers
cron clock problem
I have noticed on my RHEL 5.5 that cron daily starts an hour later (at 1AM instead of midnight). System and hardware clock are the same. How can i set it so it will start at midnight?
date
[root@a ~]# date
Wed Mar 9 12:44:35 EST…

Paxxil
- 181
- 1
- 10
1
vote
3 answers
Deleting all folders older than a specified date, except some of them
i had to do a script job in bash to delete all directory in a path which are older than a specified date except some of them.
i know the name of the directories which shouldn't be deleted...
Can you help me???
i'm sorry but i'm a beginner...
lot of…

mikjcl
- 11
- 1
- 2
1
vote
1 answer
Log "date -s" command
I know that the date -s command sets the time described by the string STRING.
What i want is to log the above command whenever it is used to set the time into the file /tmp/log/user.log.
In my Linux distribution the logging is done by…

LinuxPenseur
- 443
- 1
- 6
- 16
1
vote
5 answers
last modified date of directory
Is there any way to get the last modified date of a directory, including sub directories? either via shell script or php?
Thanks!

dcmoody
- 135
- 3
1
vote
4 answers
One Linux server has two timer
The time on one of our Linux box is very weird. Whenever I call date 3 times, the 4th call will give a wrong time(usually 1 hour later). I have setup cron to sync with ntp server. We have 20+ similar servers, only this one has this problem. Any…

garconcn
- 2,388
- 8
- 35
- 46
1
vote
1 answer
Calculate seconds minutes and days ago in shell
I have a timestamp that saves a user's last access information like
Time => 14:15:05 PM
Day => 08/23/2023
Based on this saved information, I would like to write a command that returns how much time has passed compared to the time at now 15:15:14 PM…

Luana
- 19
- 5
1
vote
1 answer
What data type do big applications use to store time data?
I am trying to find out which data type is better to store time data inside either MySQL or Cassandra database for a big application like Facebook or Instagram? There are a lot of similar questions and answers but I couldn't finally realize which…

best_of_man
- 367
- 1
- 3
- 12
1
vote
2 answers
Unable to set the date on a CentOS VM
The time on a Xen VM running CentOS 5 is incorrect. Running the date command seems to result in the expected output, but subsequent calls to date still show the incorrect time.
[xxx@xxx ~]$ sudo date -s "2010-02-08 12:26:00"
Mon Feb 8 12:26:00 GMT…

Ben James
- 21
- 3
1
vote
1 answer
Docker container with random date
I was running a container based on the image linuxserver/radarr:3.0.0.3095-ls12.
Once I updated the tag/version to linuxserver/radarr:3.0.0.3807-ls24 the application stopped working.
After debugging a little I noticed that date behaves weirdly in…

Filipe Pina
- 123
- 8
0
votes
1 answer
Convert date and time from output
I have a file with date and time on a couple thousand lines.
I need to convert:
2019/08/02-01:23:50+0000
To:
02/Aug/2019-01:23:50 +0000
I so far have
th=`grep -o '\[.*\]' test.txt | sed 's/\"//g' | head -1
echo…

Ron Russey
- 128
- 1
- 6
0
votes
1 answer
Convert date format in file
I have a file with the current date format
11.22.33.44 - - [2019/08/02-01:23:50+0000] GET www.
1111:2222:3333:4444:5555:6666:7777:8888 - - [2019/08/02-01:28:18+0000] GET www.
And i need to convert the format to like below. There are thousands of…

Ron Russey
- 128
- 1
- 6
0
votes
0 answers
ntp + ntp loose synchronize each time in 5:00 morning
we have a very strange behavior
we have 12 Linux redhat machines - redhat 7.x
two of these VM servers are loosing the time synchronize each day at 5:00 in the morning
after we restart the chronyd , then sync return to normal
but what could be the…

shalom
- 461
- 13
- 29
0
votes
1 answer
date command with formatter string is not executed in cron under Linux
I have the following crontab:
# m h dom mon dow command
* * * * * /bin/date >> /tmp/date.log 2>&1
* * * * * /bin/date "+%F_%H-%M-%S" >> /tmp/date2.log 2>&1
The first one executes correctly .. writing the current date to…

qwertz
- 121
- 4
0
votes
2 answers
Linux Script to Solaris
Hellooo!
I have the following sentence, that works on Linux, but not in Solaris Version.
YEAR=2019
echo $(expr '(' $(date -d $YEAR/9/30 +%s) - $(date +%s) + 86399 ')' / 86400) " days until deadline" the error is due to the date
Error that…

pepeargento
- 11
- 2
0
votes
1 answer
Count down date time shell script
i have 3 parameters of date "Sep 30 Mon" (Month,DayNumber,Day), and i want to make a shell script that shows the quantity of days left to reach to Sep 30 Mon.
How can i do it?

pepeargento
- 11
- 2