Questions tagged [timestamps]

timestamp is used for questions that are about data specifying seconds since the epoch (19700101T00:00:00) or possible some other standard, and also for (date) and time information in filenames.

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

My harware clock is OK, but the system clock is not, and I cannot set it

From Linux, the date --iso-8601=s command returns: 2020-10-23T22:26:22+01:00 The timezone is correct, the UTC offset is correct (England, daylight saving time). However the clock is one hour ahead. ...
4
votes
2answers
165 views

sort directories by last modified content (recursive)

I have a bunch of directories at the same level and would like to sort them according to the last modified date of the content (recursive) inside them. However, in nautilus, it looks like the ...
0
votes
2answers
52 views

Why does the year 2038 problem occur in the first place?

I've seen many questions on stack overflow about why some code isn't working with times beyond the year 2038, but the answers usually only recommend to upgrade to a 64 bit operating system. My ...
0
votes
2answers
29 views

Formatting current time [duplicate]

I would like to get time in below format 2020-10-12 10:41:42,526 How can it be done. I tried this but looks not correct date +"%Y-%m-%d %H:%M:%S,%N"
0
votes
0answers
15 views

How to Use Crontab and Timestamp to Calculate Boot Drive Reboot Speed?

I wish to test my boot drives reboot speed. I plan to do this by running a bash script that reboots the drive 100 times and at each boot, gets the time stamp. With the time stamp, I can calculate the ...
0
votes
1answer
36 views

What archival method (tar, zip, 7z, etc) allows me to retain folder modification dates on macOS?

I currently have a directory in a hard drive, say TopFolder which contains 3 subfolders, Folder1, Folder2, and Folder3. When I am in the top level directory of the hard drive, and do: tar cf TopFolder....
0
votes
1answer
15 views

Same gpg command applied on the same string but got different result

I'm new to GPG and I've learned some basic GPG commands recently. I just found that using the same GPG command to encrypt the same data always generates different result. Below is an example. Is is ...
0
votes
0answers
22 views

File access time not being updated. Is caching the reason? [duplicate]

Please see below output. After creating a file, and doing a grep for the fist time --> the file access time is getting updated. But on subsequent greps the file access time is not getting updated. $...
0
votes
1answer
20 views

A filesystem link which inherits modification date

I'm trying to update multiple arch distros over LAN according to arch wiki. In provided solution hard links are created to *.db files to /var/cache/pacman/pkg and this folder is what the web-server ...
0
votes
3answers
78 views

How to convert a kubernetes style time elapsed into seconds so I can do some comparisons

From kubectl get pods -o wide The output looks similar to some-pod-name-with-numbers-123 1/1 Running 0 6d4h 192.168.0.23 node-name-abcdeft-host.domain <none> ...
0
votes
1answer
20 views

pick date from a line and compare with current date and print a different filed from the line which is picked up

I have got the commands to pick up the date from a line comparing them with current date, I am looking to print another field from same line in if-then statement. cat /tmp/OutPrint |cut -d' ' -f 2 | ...
2
votes
3answers
157 views

How do I set a value when running find command?

I'm running a long string of -exec commands, and I want to pull a timestamp from the beginning of the run to use as a value for subsequent commands. Is this possible? Something like: find . -exec NOW=$...
0
votes
1answer
70 views

Does GNU tar incremental backup save an entire file again, even if only atime or mtime is different?

mkdir test echo "hi" > test/file1 tar -c -f archive.0.tar -g test.snar test touch -a test/file1 # changes atime and ctime, doesn't change mtime tar -c -f archive.1.tar -g test.snar test ...
0
votes
4answers
101 views

Convert all Unix timestamp (in milliseconds) in a generic text file to human-readable date

I want change Unix epoch (in milliseconds) to normal date in a generic text file. I accept bash, sed, awk or perl solutions. Example file1 (only numbers with 13 digits are dates): Foo bar ...
0
votes
0answers
22 views

birth/crtime timestamp is recorded on one xfs but not the other xfs filesystem

Two different xfs filesystems on two different Fedora. Why one of them records Birth(crtime) in the inode and why the other one doesn't? How to find the configuration/attribute differences between ...
0
votes
1answer
75 views

Can I update a ext4 filesystem's file create timestamp from Windows Powershell over a network share?

I have a script I run from Windows Powershell and it can update a files modified, and last accessed timestamps. I run the script from a Windows 7 laptop but it can update file timestamps that reside ...
0
votes
3answers
152 views

Timestmap of a SFTP-delivered file

I run a SSH server (a plain sshd) which receives files from multiple users in different timezones/DSTs via SFTP. These files are then polled and further processed by a set of worker jobs. In order to ...
0
votes
2answers
52 views

ls cmd not showing files and dirs in the order I need

I have a mymid_LS script: #!/bin/sh ls -pt it is supposed to list all files and dirs(not hidden) and sort them by the order of time modified. I made my script executable: chmod 755 my_midLS I ...
0
votes
1answer
28 views

Trying to calculate uptime and email if greater than a number of days

I need to create a script that will execute daily (cron job), calculate the uptime of the system (days only), and if that number is greater than a defined value (e.g. 30), email the system's ...
0
votes
1answer
38 views

Ask `ts` to print timestamps relative to binary start time?

Is it possible to make ts print timestamps relative to when the binary was started, rather than wall clock time? I usually use it to measure time taken between events in a single command run, so wall ...
3
votes
2answers
119 views

Invalid date when converting timestamp with awk

I'm trying to find a way to convert timestamps in log files to a Unix timestamp. The command I have come up with so far is the following: awk -F'[' '{ print $2}' | awk -F']' '{cmd ="date \"+%s\" -d \"...
0
votes
1answer
46 views

Terminal output Timestamps

I recently successfully added timestamps to my terminal prompt: https://stackoverflow.com/questions/61335641/bash-zsh-terminal-prompt-time-date/61346774#61346774 But i soon realized that what I ...
4
votes
1answer
194 views

Access time of a file

I am using bash shell. If I just open a file with the vi editor and close it without even moving the cursor even once, then that, as far as I understand, should change the last access time of the file ...
0
votes
1answer
115 views

Redirect Cron Stderr and Stdout to A Log File With a Timestamp

I'm trying to get stdout and stderr to make it to my log file for a cron process. Currently, stdout makes it as intended, but stderr does not. My timestamps are creating the issue. If I remove the ...
1
vote
1answer
96 views

sort datetimestamp column in a csv file from the command line

I have a csv file contains a datetime column format as 1 Mon Mar 02 07:42:29 UT 2020 2 Tue Mar 03 09:02:09 UT 2020 3 Mon Mar 02 01:21:29 UT 2020 I am trying to use the sort, but I dont think ...
0
votes
0answers
44 views

Linux SFTP client software (GUI based), supporting to keep file timestamp on download/upload?

Is there a Linux SFTP client software (GUI based), supporting to keep file timestamp on download/upload? I know sftp has such option, but I did not find sftp GUI client, which supports keeping ...
2
votes
1answer
219 views

File timestamps precision - ext3 with nanoseconds, ext4 with milliseconds

People say ext3 supports file timestamp precision up to seconds and ext4 up to nanoseconds. What happens is that my old VPS running Ubuntu 12.04 with an ext3 filesystem always (as far as I can ...
0
votes
1answer
268 views

How to redirect output to a log file from cron and prepend timestamp?

Most logs on my Mac have a time stamp before the output message like this: Nov 14 17:55:24 - SoftRAID Driver: SoftRAID driver loaded, version 5.8.1. I am running an executable in cron and instead of ...
0
votes
1answer
61 views

Replace timestamp format in a file

I have a file which contains the timestamp format like below. '2020-03-07T14:42:36Z UTC [ db=dev user=rdsdb pid=16913 userid=1 xid=5326 ]' LOG: SET statement_timeout TO 120000 I want to change this ...
0
votes
0answers
212 views

convert mtime to to human-readable date

I have different mtime values, and I am trying to convert them to human-readable date. I am triyng to achieve this using python: import time t = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(...
0
votes
2answers
35 views

Last modify files in folder

In a folder I have files with nanoseconds timestamps.: FileLastestFile.ext FileOther0.ext FileOther1.ext FileOther2.ext FileOther3.ext FileOther4.ext ... FileOther.ext I want to keep only file that ...
0
votes
1answer
42 views

Rsync with specific day condition in respective subdirectories

I have two identical folders with subfolders for development and live like: /development/subdirectory1 /development/subdirectory1/subsub1 /development/subdirectory2 /development/subdirectory2/subsub2 ...
1
vote
1answer
136 views

ZoL (ZFS on Linux) Resilvering Priority

I'm troubleshooting some disk issues with an embedded system, and about half the time when I reboot the SATA drive is missing. The device uses a ZFS mirror for the root partition and has one SATA ...
1
vote
1answer
100 views

How to show creation time (crtime) in Dolphin Buster?

I am using Dolphin version 18.08.0 (KDE Frameworks 5.54.0, Qt 5.11.3) which has, besides the access and modification times, a separate column for the creation time. Unfortunately this column is empty,...
2
votes
0answers
100 views

Portable way of finding files whose birth date is after a given timestamp

According to How to find creation date of file?, in Linux filesystems, such as ext4, Btrfs and JFS, that store the file creation time (aka birth time), it is possible to display the file birth time (...
1
vote
2answers
102 views

Is there a utility like rsync, but with the speed of btrfs COW?

rsync has various performance issues; I have never been able to make it perform a sync in O(#changes). Even if it uses modification time and not checksums, it still needs to generate a list of all ...
4
votes
5answers
200 views

How can I sort a list of directories alphabetically and get the first value that sorts after a specific string?

I have a directory full of backup folders, with names in the format yyyy-MM-dd--HH:mm:ss If I enter a date in the same format, is there a way to get the first directory that sorts after it, and copy ...
0
votes
2answers
63 views

Compare date and timestamps

I am trying to compare two timestamps and if x is greater than y then do some action. I tried it with bash on my Linux machine but I get an error "invalid date" here is my code: #!/bin/bash x='2020....
0
votes
2answers
276 views

Convert mm-dd-YY to Timestamp at Midnight UTC

I need to convert a mm-dd-YY string to a UNIX timestamp for use with HubSpot's API. Said API requires that dates be set to midnight UTC. I can convert the date using: date -j -f "%m-%d-%Y" "01-20-...
0
votes
0answers
39 views

locale timestamp causing overflow when executing python script

I'm trying to run a python script I wrote on my Raspberry Pi Zero, but I keep getting the error OverflowError: timestamp out of range for platform time_t. I'm relatively certain it's something with ...
0
votes
1answer
111 views

Compare timestamps

I am trying to compare timestamp of the latest modified file towards current time and if the diff is more than two hours I am trying to print that out. How can this be done? The following command ...
0
votes
0answers
142 views

ksh not saving history in it's HISTFILE and HISTTIMEFORMAT not working

I have created a custom shell script and put it inside /etc/profile.d/ that declares the HISTFILE. It works on bash and sh however it does not seem to work in ksh. As can be seen below, it gets the ...
0
votes
1answer
90 views

Grep - return different line sized contents after a match

I need to find a way for grep to return different line sized contents after a match. Some matches have 4 lines after them, other have 20. I need them all. Every hour I am looking to return the ...
2
votes
2answers
54 views

Get last X minutes of log file that has particular timestamping

I am trying to go through an IPA host's log file to grab the last five minutes of content and get updates on things like new user creations or DNS changes. I want to cron this so every five minutes it ...
0
votes
1answer
29 views

strftime - ignore empty fields

input sample: one two 1578678600 awk command: $ echo -e "one\ntwo 1578678600"|awk '{print $1,strftime("%Y-%m-%d %H:%M:%S", $2)}' one 1970-01-01 00:00:00 two 2020-01-10 17:50:00 How strftime could ...
1
vote
2answers
123 views

Force the stdout, stderr logging with timestamp

I have a Raspberry-Pi based device that takes input from switches and sensors connected to its GPIO, as well as from Arduino connected via TTY serial. The main app managing all this is written in ...
0
votes
2answers
244 views

list filenames stored in text file with a certain timestamp

I have stored a couple of file names in a text file by the name new1.txt in my home directory, now i'm using a loop to list all the files in the directory they are present in. I am able to write the ...
0
votes
1answer
38 views

use one date variable but format it different ways

In a shell script, there are the following variables: datestamp=$(date '+%Y-%m-%d_T%H-%M-%S') datestamp_pretty=$(date '+%m/%d/%Y at %I:%M:%S %p') The first one is used as part of the output filename ...
1
vote
1answer
411 views

Extract last lines of a logfile by time

tail -n 100 myfile.log gives my the last 100 lines of myfile.log. Is there an existing tool that expects the first "column" of each line in a file as a timestamp and can give me the n last hours/...
0
votes
3answers
158 views

Transform Timestamp inside of the text file

I extract the tables from UDB to local into csv file format. After I extract it, my time stamp which shows up multiple times is messed up. I would like to write shell script to update it when it sees ...

1
2 3 4 5
10