Hi,
I am not aware whether any one has posted this early or not.
I am creating a house keeping script in which I give the user two options:
1. creating a zip file.
2. removing all files given by user.
Before taking any action I am asking user to
enter full path of file or files to be removed/zipped.
and File name [any char like file extn , file name , last date modified]
Here is my script:
#!/bin/sh
echo "HOUSE KEEPING"
echo "-------------"
echo "You want:"
echo "1. zip files."
echo "2. remove files."
read option
echo "Enter full File path:"
read PATH
echo "Enter File name:"
read FILE
echo "Enter Date:"
read DAYS
if [ option -eq 1 ]
then
#zip files
/usr/bin/jar -cvf $FILE.jar $PATH
#/usr/bin/find $PATH -type f -name "*$FILE*" -mtime +$DAYS > tmp.txt
fi
if [ option -eq 2 ]
then
#rm files
/usr/bin/find $PATH -type f -name "*$FILE*" -mtime +$DAYS -ls -exec rm -f {} \;
fi
Now the issue is when I select option 1 that is to zip file, I am getting
this error
./House_Keeping2: /usr/bin/jar: not found
I found the path is fine.
could plz help me making this working
thanks