Pages

Affichage des articles dont le libellé est Bash. Afficher tous les articles
Affichage des articles dont le libellé est Bash. Afficher tous les articles

Bash, find and delete files (help)

mercredi 3 août 2016

Hi all

As many others i have created my own backup solution (Bash) for a tailored system, which works just as expected.
Now i've reached the stage that i also need to delete unwanted backups and here i have a question i am hoping to get a little help with.

All my backups follow the same pattern
year-mm-dd-week-timestamp.full.dir
year-mm-dd-week-timestamp.inc.dir

Question
During a week i dont necessarily end up with 7 backups, since some days i do more than one incremental backup.
So lets say i want to delete backups for two weeks, and this equal 20 backup folders.

How can i in Bash say "find & delete 2x X.full.dir backups + all associated inc backups"?

I am not a programmer, so i dont know the technical term for the above.
If their is a smarter way of doing the above please let me know so i can learn.

Thanks on advance!!
Kind regards

Let's block ads! (Why?)



Bash, find and delete files (help)
Read more ...