this is a question about bash shell scripting. in /var/log/httpd i have these files (this is vastly shortened, as there are many more domains involved):
www_websanity_com_access_log_20050805 www_websanity_com_access_log_20050806 www_websanity_com_access_log_20050807 www_websanity_com_access_log_20050808 www_websanity_com_access_log_20050809 www_websanity_com_error_log_20050805 www_websanity_com_error_log_20050806 www_websanity_com_error_log_20050807 www_websanity_com_error_log_20050808 www_wildstonemedia_com_access_log_20050805 www_wildstonemedia_com_access_log_20050806 www_wildstonemedia_com_access_log_20050807 www_wildstonemedia_com_access_log_20050808 www_wildstonemedia_com_access_log_20050809 www_wildstonemedia_com_error_log_20050805 www_wildstonemedia_com_error_log_20050806 www_wildstonemedia_com_error_log_20050807 www_wildstonemedia_com_error_log_20050808 www_wildstonemedia_com_error_log_20050809 www_wpc-stl_org_access_log_20050805 www_wpc-stl_org_access_log_20050806 www_wpc-stl_org_access_log_20050807 www_wpc-stl_org_access_log_20050808 www_wpc-stl_org_access_log_20050809 www_wpc-stl_org_error_log_20050805 www_wpc-stl_org_error_log_20050806 www_wpc-stl_org_error_log_20050807 www_wpc-stl_org_error_log_20050808 www_wpc-stl_org_error_log_20050809 i want to move the www_websanity_com files previous to today (20050809) to this directory: /var/log/archives_pre/www_websanity_org i want to move the www_wildstonemedia_com files previous to today (20050809) to this directory: /var/log/archives_pre/www_wildstonemedia_org i want to move the www_wpc-stl_org files previous to today (20050809) to this directory: /var/log/archives_pre/www_wpc-stl_org and so on and so on. i can create a file that contains the list of domains that i want to move files for, that would look like this (it would be a LOT longer): ... www_websanity_org www_wildstonemedia_org www_wpc-stl_org ... and so on with the date command, formatted as "date +%Y%m%d", i can get today's date: 20050809 so, how do i write a script that reads the file that contains the list of domains, looks in /var/log/httpd for the files for each domain previous to today, and then moves those files to /var/log/archives_pre/[domain_name]? i'm thinking the find command would do what i wanted, but i'm not sure how to read in the list of domains from a file. thank you very much! scott -- R. Scott Granneman [EMAIL PROTECTED] ~ www.granneman.com Full list of publications: http://www.granneman.com/publications My new book on Firefox: Don't Click on the Blue E! Info at: http://www.oreilly.com/catalog/bluee/ Read the Open Source Blog: http://opensource.weblogsinc.com Join GranneNotes! Information at www.granneman.com "We confess our little faults to persuade people that we have no large ones." ---Francois de La Rochefoucauld _______________________________________________ CWE-LUG mailing list [email protected] http://www.cwelug.org/ http://www.cwelug.org/archives/ http://www.cwelug.org/mailinglist/
