![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| House of Mirrors 0.4 (Default branch) | iBot | Software Releases - RSS News | 0 | 04-12-2008 02:20 AM |
| House of Mirrors 0.3.1 (Default branch) | iBot | Software Releases - RSS News | 0 | 04-04-2008 01:00 PM |
| House of Mirrors 0.3 (Default branch) | iBot | Software Releases - RSS News | 0 | 04-03-2008 12:50 PM |
| Automatic House keeping in UNIX | augustinep | UNIX for Dummies Questions & Answers | 3 | 11-24-2001 10:42 AM |
| Help! Newbie in the house!!! | The Nutcracker | UNIX for Dummies Questions & Answers | 4 | 07-03-2001 02:12 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
house keeping script
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 |
|
||||
|
Quote:
can i use zip instead of tar. like in zip we have option to get list of input files from standard input using: find . -name "*.[ch]" -print | zip source -@ Can I do the same using tar. thanks |
|
||||
|
Hi,
I tried the above command,however I am getting error: ------------- HOUSE KEEPING ------------- You want: 1. zip files. 2. remove files. Enter your option:1 Enter full File path:/home/rb26326/our_scripts/test Enter File name:.log Creating zip file ./House_Keeping2: xargs: command not found Can you let me know what has to been done. thanks, |
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|