Except checking whether the folder is empty or not, i would also like to know whether the *.log files are removed. Here is another example.
Continue reading Shell Script – Check the existence of files which have common file name
I am working on a housekeeping shell script to delete old files and update some files. I want to know whether the .sh is completed without problem. So i made a checking part in the shell script.
Continue reading Shell Script – Check Empty Folder
Usually, we have to manipulate the file time attributes in the shell script in order to complete the task. Just like the example at Shell Script – Delete Old Files
Continue reading Shell Script – stat
For housekeeping the backup files on a server, we can write a shell script to remove files which were created some days ago and scheduled it by cron job.
The following code is an example to remove backup files which were created 90 days ago. Please note that the target folder is just the same as the .sh file location and the .sh file is excluded in the command.
Continue reading Shell Script – Delete Old Files