![]() |
|
|
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 |
| read file from tar.gz archive | krylin | High Level Programming | 9 | 05-20-2009 05:51 PM |
| read list of filenames from text file and remove these files in multiple directories | fxvisions | Shell Programming and Scripting | 5 | 08-07-2008 04:59 PM |
| unzip .zip file and list the files included in the .zip archive | oracledev | UNIX for Dummies Questions & Answers | 5 | 04-08-2008 05:49 PM |
| Read file and remove max length | mr_bold | UNIX for Dummies Questions & Answers | 5 | 01-24-2007 08:51 PM |
| Read from file then purge or archive. | kayarsenal | Shell Programming and Scripting | 15 | 08-10-2006 09:24 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
read list of filenames from text file, archive, and remove
I posted a week ago regarding this scripting question, but I need to revisit and have a few more questions answered..
User cfajohnson was extremely helpful with the archive script, but clarification on my part is needed to help steer the answer in a direction that works in this particular production environment. The basics: I have a large list of filenames, running in the thousands, with varying extension types....these extensions and . were pruned from this list, strictly just filenames now, ex., "filename.psd" has been changed to "filename" The need: To search through our production server traversing through multiple directory trees and to archive these files, each file size ranging anywhere from 200 KB to 200 MB with different file extensions such as .psd, .eps, or nothing at all, keeping in mind that directory structure in the archive is not necessary, only the file itself as a backup in one archive directory. Once backed up on DVD, etc., this file list can then be read from again and used to delete all files on the server traversing through multiple directory trees while maintaining directory structure and any other files inside these directories that do not match the file list being used. The catch: Having some trouble executing scripts, even simple ones such as: #!/bin/bash # script to list files and permissions, name: listFiles ls -l The permissions were changed to execute the file, i.e., chmod +x listFiles ...however, after attempting to execute the file at the command line by simply typing listFiles (I also tried typing $listFiles), bash returns with: -bash: listFiles: command not found Perhaps my permissions as admin or user are incorrect? or my path to /bin/bash needs to include a full path back through my permissions tree as a user? Also, thank you to users srikanthus2002 and jacoden with: find / -type f -name "fil*" -exec rm {} \; however, is "fil*" actually READING the list provided in the file and using that list to feed or pipe into -exec rm {}, or strictly looking for the filename of the list file and deleting the list file? Thanks for your help! Last edited by fxvisions; 03-19-2007 at 05:43 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|