![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create Year directory, date subdirectory and archive the file | madhunk | UNIX for Dummies Questions & Answers | 2 | 12-13-2007 11:25 AM |
| Specify a previous date as start date in shell script | ritzwan0 | Shell Programming and Scripting | 2 | 09-25-2006 06:58 PM |
| Directory create date | Bab00shka | UNIX for Dummies Questions & Answers | 2 | 06-29-2005 11:42 AM |
| create directory named current date | flowrats | UNIX for Dummies Questions & Answers | 2 | 07-31-2002 12:26 AM |
| How to find Previous date and Coming date | arunava_maity | UNIX for Dummies Questions & Answers | 2 | 05-24-2001 12:41 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
want to create directory with the previous date
I need some help to complet the below script:
DATE1=`date "+%d"` #DATE2=`expr $DATE1 - 1` #DATE3=$DATE2`date "+%m%y"` DATE4=`date "+%a"` if [ $DATE4 = Mon ]; then DATE2=`expr $DATE1 - 3` else DATE2=`expr $DATE1 - 1` fi cd /data/builds/612hf8/SAS/retail/plan_61/scripts/meserver DATE3=$DATE2`date "+%m%y"` mkdir $DATE3 echo "dir created" mv *.log $DATE3 echo "logs moved to $DATE3 folder" The above script creates the directory with the previous day date. along with the above script output, i need how to create month end directories that means 30th or 31st of date. if suppose date is 1st of any month, this script not creating directory of the previous date that is 30th or 31st. Please some body help me to complete above script. I would appreciate your help. Thanks, Sridhar. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|