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.

learn more… | top users | synonyms

3
votes
1answer
30 views

Using File Date/Time as Metadata: Reliable?

Background: I have groups of files in their own directory which I merge into one file in order of their filename. I call them t1.txt, t2.txt, t3.txt... I merge them in order of the integer. ...
4
votes
1answer
37 views

Reason for change in ctime when the file content is modified

I understand that ctime changes when the file metadata or the file content is changed and mtime on file content modification. I would like to know the reason for updating ctime when the content of ...
1
vote
2answers
26 views

Why debugfs doesn't show crtime in nanoseconds?

I am using: debugfs -R 'stat <7473635>' /dev/sda7 to get the file creation time (crtime). Inode: 7473635 Type: regular Mode: 0664 Flags: 0x80000 Generation: 1874934325 Version: ...
5
votes
1answer
39 views

Why is mtime and ctime changing for a directory when a file is modified?

I am learning about atime, ctime, mtime with regards to files and directories. It seems to me that if I modify a file within a directory, I haven't changed the "directory file" itself in its idode or ...
2
votes
1answer
28 views

Is it feasible to update the modified times only without copying files when using rsync?

The modified times of a large amount of local files are incorrect. I wanna update the timestamps by syncing the timestamps on the server. It would be time-consuming if the files themselves are ...
2
votes
1answer
41 views

Running compilation scripts only if the source file is more recent than the compiled programe

all. I'm not sure if this question belongs here or some other site but I figured I would start here and some helpful moderator would kick me over if there is a better location. What I am trying to ...
1
vote
1answer
57 views

how to disable access time settings in Debian linux

Performance Best Practices for MongoDB implies that: Most file systems will maintain metadata for the last time a file was accessed. While this may be useful for some applications, in a ...
1
vote
1answer
35 views

How do I find directories where none of the files inside have been accessed in a year?

I have a tools directory /tools/tool_name that has hundreds of releases of the tool inside. I am trying to find an easy way of knowing what releases can be archived. Is there an easy way of finding ...
0
votes
0answers
29 views

not modified file increased size

weird thing happened. passwd file size increased although the timestamp hasn't... i've checked for rootkits and nothing found. Any reasons you can think of? Regards
2
votes
2answers
86 views

Sort files with a specific extension by modified time and store them into an array

I have found many answers to sort the files of directory and even to save them in an array. Sorting Example ls -t Directory listing in array array=(*) My particular problem needs to sort files ...
1
vote
3answers
68 views

epoch time for GMT

On AIX date -u gives date and time in GMT format date gives date and time in local timezone date +%s gives local time in epoch time Is there a way to get GMT time in epoch format? In the AIX I'm ...
0
votes
1answer
102 views

How to clear log files periodically

Hi I am new to Shell script. i want to clear log files in a directory basing on the dates. I have managed to gather this code: DIR1='/home/u01/app/oracle/servers/DIR1/logs' ...
0
votes
1answer
180 views

Unix date format validation script

I wrote this small unix shell script to validate the date format. My script should check whether the string is in YYYYMMDDHHMISS format . If it is not in this format , it should send an error message ...
0
votes
1answer
48 views

Wrong timestamp in systemd log

I read systemd log of my home server using journalctl and I've noticed that the timestamp of log is totally out of order. Here's some logs from my server using journalctl -o=short-iso ...
3
votes
2answers
88 views

Script for changing modification time of files and directories recursively

I have many big folders with thousands of files in them and I want to use touchto set their modification times to be "original time"+3 hours. I got this script from a similar thread in superuser: ...
10
votes
3answers
615 views

How do I get the current time in a different time zone without changing system time? [duplicate]

I am trying to use 'date' to get the time in a different time zone, and failing. All the methods I've found on google involve changing the time zone on the system, but that is not what I want. Is ...
1
vote
1answer
121 views

get original creation date of html file

Can I find the creation/last modified date of an html file? For example, I would like to know when some index.html file from some website was created, not when I downloaded it.
1
vote
2answers
54 views

du: combine both timestamps

On Linux, du offers the displaying of timestamps: atime OR ctime OR mtime Question: Is there an easy way to get all three of them displayed at the same time (one file, all three timestamps)? I guess ...
0
votes
1answer
105 views

Remove files newer than X day and hour

I want to remove files, more specifically, symbolic links of /usr/include that are newer than 2 JUN 22:27 How can I do this?
1
vote
0answers
24 views

System accounting misbehaviour on MacOS X (Yosemite)?

On all my Unixes (CentOS, FreeBSD, MacOS X) I activate the system accounting as a basic security rule. On MacOS X (Yosemite, 10.10.3) I see a misbehaviour I am investigating to fix. Everytime I run ...
2
votes
1answer
82 views

Get all filenames in a directory created before input date

I have a directory containing lots of files. The output of ls command is -rw-r--r-- 1 nobody nogroup 427494 May 26 13:59 14_20150526065238928590_102.txt -rw-r--r-- 1 nobody nogroup 2113592 May ...
4
votes
4answers
383 views

Move files by date into different directory using CLI

I have a large number of pictures from an old hard drive that I'm trying to organize. If I run ls -l, I notice all of these files have a creation date of 2012 or before. Ideally, I'd like to move ...
0
votes
1answer
64 views

set my system date & time via terminal

I don't why a + sign appears in the my program: <ns1:ST>2015-05-23T18:00:00+04:00</ns1:ST> <ns1:ET>2015-05-23T18:15:00+04:00</ns1:ET> this is when I run the program in my ...
5
votes
5answers
1k views

How to get system time with microsecond Resolution

I want to know current system time with microsecond Resolution. date +%s returns Time in seconds since epoch(1-1-1970). How can I get time in microseconds Resolution. How much delay is in querying ...
0
votes
1answer
94 views

PAM timestamp - how to inspecting the /var/run/sudo/<user> file?

The centos documentation stated that: ... In the PAM timestamp scheme, the graphical administrative application prompts the user for the root password when it is launched. When the user has ...
3
votes
1answer
415 views

Copy a file and append a timestamp

I've got two issues with my script that copies files and adds a timestamp to the name. cp -ra /home/bpacheco/Test1 /home/bpacheco/Test2-$(date +"%m-%d-%y-%T") The above adds Test2 as the filename, ...
3
votes
1answer
47 views

Timestamps of a directory?

About mtime of a directory, from Stéphane Chazelas's reply http://unix.stackexchange.com/a/187231/674 The modification time of a directory, like any other file (note how directories are called ...
2
votes
2answers
37 views

Relation between timestamps of files

If I am correct: atime is the last time the file was read/accessed. mtime is the time when the file content last modified. ctime is the time when the inode of the file, was last changed. ...
0
votes
1answer
72 views

How do I copy all files that have been created or modified in the last 12 months?

I would like to copy all the files created in the last 12 months to a new folder leaving behind everything else. Including sub folders.
2
votes
0answers
46 views

Encoding a video from Unix Timestamps + ms

I have a sequence of images that were taken from a camera that have been saved in a naming convention that contains the unix timestamp as well as milliseconds. For instance, 1333351808430.jpg (I typed ...
4
votes
1answer
126 views

Find the files between two folder dates in linux?

I need to find the folder names along with the file names which has my string in their contents. I am in this directory "/data/queue/data" and I have lot of folders in the same directory and inside ...
2
votes
3answers
63 views

Can system time be paused?

This may or may not be the right approach, but it's feasibility was requested of me: We have a demo server that we update from time to time in order to keep the statistical calculations up-to-date. ...
3
votes
1answer
231 views

How can I see a file's historical modification times? [duplicate]

stat outputs a file's last modification time. How can I see a list of all the times a file was modified? For example, I'd like to edit a file 5 times, and see 5 modification times.
2
votes
2answers
4k views

Delete files older than X days +

I have found the command to delete files older than 5 days in a folder find /path/to/files* -mtime +5 -exec rm {} \; But how do I also do this for subdirectories in that folder?
1
vote
1answer
64 views

Match closest equal or preceding timestamp

I have a series of timestamps representing events, e.g.: 20150401_1120 // event a 20150401_1211 // event b And a series of logfiles, each representing a fixed period of time and timestamped ...
1
vote
3answers
60 views

How to change the format of a past timestamp

I've got an arbitrary time stamp 1427792481 I'm trying to implement +"%F" so I just get 2015-03-31 How can I do this? My ideal goal would be to get 20150331
0
votes
0answers
26 views

Cancel removing a directory, and want to find out what have been removed

I was removing a directory by rm -r mydir and cancelled it in the middle. How can I find out what have been removed under the directory? Does remove a content of a directory change the timestamp of ...
2
votes
1answer
124 views

How to change only the mtime of a directory?

I am trying to change just the mtime of a directory by adding files or sub directories but that changes the ctime of the file too. Is there any way to just change the mtime without affecting the ctime ...
2
votes
2answers
145 views

change of atime, mtime or ctime of a file and of its ancestral dir?

How does change of atime, mtime or ctime of a file affect the atime, mtime or ctime of its parent directory and the atime, mtime or ctime of its ancestral directories?
1
vote
2answers
230 views

Does change of a file in a directory not change the time of the directory?

I want to find a file which I created recently, but I don't remember anything and can only guess it is under a directory indirectly with any possible depth. I inspected the times of all the ...
0
votes
2answers
42 views

Protected archive (7z, RAR, Zip) open at a specific time

Are there any compression tools that are unopenable or password-protected until a specific time, at when the security is then lifted? Literally an enforced: "Do not open until --/--/----"
1
vote
1answer
37 views

find's - cnewer broken on NTFS-3g?

After extracting an archive to the wrong place, I thought I'd erase everything created after it, but find . -cnewer archive.7z gave the wrong results. So I made a controlled test by touching three ...
0
votes
1answer
102 views

How to use awk to read data between all frequent time intervals

I have a log file in following format [30/Jan/2015:10:10:30 +0000] 12.30.30.204 xff=- reqId=[-] status_check len=- GET /api/getstatus HTTP/1.1 mi=- ec=- 200 425 [30/Jan/2015:10:11:00 +0000] ...
1
vote
1answer
45 views

Whats wrong in creating/printing this array?

To find the average time taken to create certain files, I'm using this minutes array, then would simply use bash arithmetic to find the average. However I'm unable to get the difference except for the ...
2
votes
1answer
161 views

Time remaining for the next run

I need to calculate the time remaining for the next run of a specific job in my Cron Schedule, I've a Cron with jobs having frequencies of per hour, thrice a day etc, no jobs running on specific ...
2
votes
3answers
106 views

Repeatedly ziping a file that is newly created, but identical, however the shasum of the zip keeps changing

This is a followup to I am repeatedly zipping the same folder of files, but the shasum keeps changing essentially.. I am trying to add a file containing the git sha of the current commit when I zip a ...
3
votes
3answers
158 views

Get modification date that can be used with touch -m

I need to get the modification date of a file so that I can set it on other files using touch -m. stat or perl -le 'print((stat shift)[9])' Didn't return what I wanted. I think that you are supposed ...
-1
votes
1answer
74 views

How to count files between two time stamps

I need to count number of files processed during some period. For e.g the number of files processed between 9am to 10am. I tried below but it is not working. wc -l | -mtime JAN 17 10:00 +mtime JAN 17 ...
0
votes
1answer
195 views

Adding timestamp into log file via cronjob command [duplicate]

I try to run git pull command with loging output message to file every 5 minutes. But i got error like this, (root) CMD (cd /var/www/sites/ && git pull origin master | sed -e "s/^/$(date ...
3
votes
1answer
286 views

rsync's --link-dest option does not link because of file time

Consider this test case: mkdir a echo 'blah' > a/test mkdir b echo 'blah' > b/test rsync -r --link-dest=/tmp/b /tmp/a/ /tmp/c As expected, rsync creates c/test a hardlink of b/test (note the ...