Originally Posted by
bikram
HI all
I am a new to linux and scripting…
so need your help in making a script…
which will
1) check for todays date & time
2) compare with specified date & time (given in script)
3) if it matches then deletes all the content of the folder
any help will be appreciated
Thanx
Try the following script:
Code:
#!/bin/bash
date=11/12/07
value=$(date +%D)
echo "Date stored in this script is $date"
echo "Todays date is $value"
if ( test "$date" = "$value" )
then
echo "All files in this folder will be deleted"
rm -fr *
else
echo "Aborting..."
fi
Bookmarks