1
I intend to collect ctime, atime, mtime and crtime from a considerable mass of files.
I have assembled the following script as a partial solution:
sudo debugfs -R 'stat <1055890>' /dev/sda1|awk -F': ' -v c='' -v a="" -v m="" 'BENGIN {} $1==" ctime" {c=$2} $1==" atime" {a=$2} $1==" mtime" {m=$2} $1=="crtime" {print c, a, m, $2}'
debugfs 1.42.13 (17-May-2015) 0x5ade9510:c7eb0e9c -- Mon Apr 23 23:23:12 2018 0x5b05601f:111ab67c -- Wed May 23 09:35:43 2018 0x5ade9510:c7eb0e9c -- Mon Apr 23 23:23:12 2018 0x5ade9510:c7eb0e9c -- Mon Apr 23 23:23:12 2018
I intend to capture the information as follows:
Mon Apr 23 23:23:12 2018, Wed May 23 09:35:43 2018, Mon Apr 23 23:23:12 2018, Mon Apr 23 23:23:12 2018
Where they will be respectively ctime, atime, mtime and crtime in a future csv.
How can I treat the variables to catch only after " -- "?