index | About timestamps | Blog index

Linux timestamps, Started 5/2/2024

On Linux there are ways to set changed at time and created at time for files. For example:
xfs_db -c "inode <inode_number>" -c "chattr <new_change_attribute>" /dev/device_name

That is for changed at timestamp on XFS. 
BTRFS:
chattr --ctime="2022-01-01 12:00:00" filename
ZFS:
zfs set creation=2022-01-01T00:00:00 pool/dataset/file

Test this before large scale but these things may do setting changed at time. Assume you must do this on unmounted systems but do your own research. I also researched man pages.


So there are ways to set BTRFS, XFS, and others like ZFS or F2FS. I heard stuff like these and debugfs works on F2FS. I have not tested these so these are just research for now. With that all timestamps that are on systems can be recorded and reset. I know rsync supports -N, created at, and -X, extra attributes, but some attributes may not always be copied on all systems. "touch" can set last modified and last accessed. Timestamps that require like debugging tools are changed at and created at. Be careful as some attributes may have an extra and just set as seconds.

X E.