E
E
Exodus112021-05-20 18:18:14
linux
Exodus11, 2021-05-20 18:18:14

How to find files changed in the last hour and add them to the archive?

I came to this find /var/log -cmin -60 | xargs tar -cf file.tar,
But it writes all files without doing a time check.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2021-05-20
@Exodus11

find /var/log -mmin -60
cmin is change time

M
MegaLite, 2021-05-20
@MegaLite

find - option -mtime it seems. You can find out more precisely in your distribution and apply the answer of the previous speaker, plus the output of find --help and look there for the mtime (Modification Time) option (Again, this will most likely only work if the filesystem is mounted without the noatime flag)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question