Timestamps all Linux setting maybe
Tags backup, restore, timestamps
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 chaned at 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 except ZFS which is created at. Assume you must do this on unmounted systems but do your own research. I also researched man pages.
https://linux.die.net/man/8/xfs_db
https://linux.die.net/man/8/zfs
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. How people live without ease of transfer of timestamps and in some cases restore possibilities is mysterious. X E.
xfs_db -c "inode <inode_number>" -c "chattr <new_change_attribute>" /dev/<device_name>
That is for chaned at 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 except ZFS which is created at. Assume you must do this on unmounted systems but do your own research. I also researched man pages.
https://linux.die.net/man/8/xfs_db
https://linux.die.net/man/8/zfs
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. How people live without ease of transfer of timestamps and in some cases restore possibilities is mysterious. X E.
Total Comments 3
Comments
-
Well, BTRFS proven wrong, no way to set on that, and I doubt xfs stuff. I would delete this if I could. X E.
Posted 10-24-2024 at 06:21 PM by maybeJosiah -
File times can be modified using touch, which is filesystem agnostic.
For example:
Code:touch some.file
More interesting & useful options for the touch command can be found in the man page.Posted 10-25-2024 at 12:55 PM by jr_bob_dobbs -
Currently, as of 2024-2025, can BTRFS or XFS set new or change current default birth time ?
Posted 12-04-2024 at 12:58 AM by anmac1789