The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
"too big" and "not enough memory" errors in shell script jerardfjay AIX 11 03-16-2009 11:09 PM
shell script to replace a line contain an unkown pattern starting with "aaa, bbb" Dingrong UNIX for Dummies Questions & Answers 2 10-07-2008 10:06 AM
passing a list of dynamic names to a "PS" command in shell script? sachin.tendulka Shell Programming and Scripting 3 11-21-2007 04:18 AM
Q: Recording shell script screen output using "script" command ? lalfonso.gomez Shell Programming and Scripting 4 01-18-2007 09:31 PM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 04:15 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-04-2009
jhampt jhampt is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 7
Help with shell script "wget"

I am trying to gather a list of files (products) every 30 days that have been added to a website. First it will delete the files that are already in the directory from 30 days ago. Then it will it gather the updated files (products) from the webstie and it will place them in a directory. Lastly it will tar the files that are in the directory. If anyone knows how to get this done your assistance would be appreciated.
  #2 (permalink)  
Old 04-04-2009
dennis.jacob dennis.jacob is offline Forum Advisor  
dj - the student
  
 

Join Date: Feb 2007
Location: Singapore/Bangalore/Cochin
Posts: 610
Quote:
Originally Posted by jhampt View Post
I am trying to gather a list of files (products) every 30 days that have been added to a website. First it will delete the files that are already in the directory from 30 days ago. Then it will it gather the updated files (products) from the webstie and it will place them in a directory. Lastly it will tar the files that are in the directory. If anyone knows how to get this done your assistance would be appreciated.
The requirement is not clear..However, u can try:

Quote:
- What is the content of webpage? Paste a sample source of website
- For deleting files, you can go for
find dir_name "*" -type f -mtime+30 -exec rm {} \;
- From where the source files will be available?
- you can do a tar by
ls -1 | xargs tar cvf file.tar -
  #3 (permalink)  
Old 04-06-2009
jhampt jhampt is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 7
The content is on our intranet and I am unable to disclose the specifics. It is bascially a website were analyst post their findings. I need to pull these posting every 30 days into a directory and tar them. Here is what i have come up with so far:

#! /bin/sh
#script.sh
[ -z $1 ] && " Defaulting to $ (date +%F)" && DATES=$ (date +%F) || DATE="1"
touch -d "1" /tmp/OLD
touch -r /tmp/OLD -F 2592000 /tmp/NEW
# /tmp/NEW 30 days newer than /tmp/OLD
find . -name * -newer /tmp/OLD ! -newer /tmp/NEW ! -size 0
rm -f /tmp /OLD /tmp/NEW/NEW

I have to figure out how to incorporate either a get or wget to pull the updates.
I hope this makes it a little clearer. Thanks for the initial response.
  #4 (permalink)  
Old 04-06-2009
jhampt jhampt is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 7
Another solution is to use:
grep "/products/2009" after the get command but how would I only grep for a specific timeframe.... ie 30 days
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0