I am using Debian 10 Buster and I am a Linux newby. It´s never too late..
I am collecting pictures in order to create a long-term time lapse video of a construction site across the street.
All of the pictures are in a directory inluding pictures taken Saturday and Sunday.
The filenames are formated like this:
YYYY-MM-DD_HHMM.jpg
example
2021-05-07_1012.jpg
Now i am trying to remove pictures that were created Saturdays and Sundays.
When executing below (from another thread here) I am able to list all files created Saturdays and Sundays:
find -type f -printf '%Ta\t%p\n' | egrep "^(Sat|Sun)" | cut -f 2-
The question is: How do I modify this line into a delete statement to remove the files?
Another option could be (i store the files on a nas) the exclude the files when copying them into my working directory.
I use rsync to copy the files over.
Thanks in advance.
As far as i can see, this generically removes files based on patterns. Here there is no pattern as such, I would need to extact the weekdays from the file properties and then delete Sat and Sun only.
– prankprompidelio Aug 18 '21 at 09:30xargs
, thefind
command in that question does not matter. – Panki Aug 18 '21 at 10:49