Skip to content

Commit 2ee9cc7

Browse files
author
Ankam Ravi Kumar
authored
Update README.md
1 parent 14c9f52 commit 2ee9cc7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# shell scripting tutorial
1+
# Shell Scripting Tutorial
22

33
Keep in touch with for any kind of technical questions
44

@@ -100,3 +100,15 @@ After that start learning shell scripting using below topics
100100
- [Shell Scripting Book](https://arkit-in.tradepub.com/free/w_pack42/)
101101
- [Shell Scripting Book](https://arkit-in.tradepub.com/free/w_advb01/)
102102
- [Shell Scripting Book](https://arkit-in.tradepub.com/free/w_wile54/)
103+
104+
**Write Your Own Method of Script for below Scenario**
105+
106+
- **Scenario:** Everyday from Monday to Friday one directory will be created under /fullbackup/dailybackup/YYYY-MM-DD and it will move backup to its parent directory everyday midnight /fullbackup/archive/, However Saturday, Sunday and Monday directories will move to /fullbackup/archive path every monday evening.
107+
108+
- **Directory Names Example:** 2018-12-24 2018-12-25 2018-12-26 2018-12-27 2018-12-28
109+
110+
- **Question:** I would like to delete directories older than two days from /fullbackup/archive path. How do you do it using any scripting methods.
111+
112+
- **Problem Statement:** I was trying to use ```find /path/ -type d -mtime +2 -print0 | xargs -r0 rm --```. This command does not works as expcted due to directory modified date for SAT, SUN and MON are Mondays date.
113+
114+
- **How Do you solve it.??** Write Shell Script to accomplish this task. Should run through crontab and clear directories older than two days.

0 commit comments

Comments
 (0)