I am taking one of important folder every day backup by using cron. That folder name it will store with the current date.
Now my requirement is i need to keep only the current day and last two days backup.
i.e (i want to keep only test_2016-11-04.tgz ,test_2016-11-03.tgz , test_2016-11-02.tgz)
Remaining folder it has to delete automatically. Please let us know how to do in shell script.
Below is my backup folder structure.