sample script to archive & move previous day syslog files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sample script to archive & move previous day syslog files
# 1  
Old 05-21-2009
Data sample script to archive & move previous day syslog files

hi all.

Please help me with archiving previous day syslog files.
the files have no extension and have the format YYYY-MM-DD.
I want to archive the file then move it to some other machine.

thanks.
# 2  
Old 05-21-2009
Instead of trying out scripts by own ..

Look at logrotate which is meant for the specified purpose.
# 3  
Old 05-21-2009
thanks for this utility.
but the manual says it does rotation, compression,removal.

The rotation is already configured as i am using syslog-ng
I think logrotate will not achieve what i want Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How archive the older than 30 day files to another unix server

I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script. for LOOK_DIR in /TempFiles do for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;` do echo ${FILE} >> file_list ## This file will have the list of files copied and... (12 Replies)
Discussion started by: murari83.ds
12 Replies

2. UNIX for Dummies Questions & Answers

List the files of previous day

I am using KSH. d=date | nawk '{ print $2,$3-1}' ls -lrt SystemOut* | nawk '/d/{print $NF}' I am trying to list the files of previous day but it doesn't seem to be working and i am also not getting an error. result is blank.Need help. (11 Replies)
Discussion started by: vagar11
11 Replies

3. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

4. Programming

Script for creating a directory & move the .tif files in it.

Hi Team, I have thousands of TIF files which are converted from PDF. Below is a sample of it. LH9406_BLANCARAMOS_2012041812103210320001.tif LH9406_BLANCARAMOS_2012041812103210320002.tif LH9406_BLANCARAMOS_2012041812103210320003.tif LH9411_ANGENIAHUTCHINSON_2012041812102510250001.tif... (9 Replies)
Discussion started by: paragnehete
9 Replies

5. Linux

Create folder by script & move files in it

Hi Team, I have over 1 lakh pdf files. I want to create folders like Disk-1, Disk-2 ..... & want to move 3000 pdfs per folder. Can i do it by script? Please help me. Thanks & Regards Parag Nehete (4 Replies)
Discussion started by: paragnehete
4 Replies

6. Shell Programming and Scripting

Script to check if last modified day is previous day

Hi, I would like to write a script that checks if a file ('counter') was modified the previous day, if so erase its contents and write 00000000 into it. For e.g. if the file 'counter' was last modified at 11.30pm on 24th May and the script runs at 12.15am of 25th May, it should erase it's... (1 Reply)
Discussion started by: hegdepras
1 Replies

7. Shell Programming and Scripting

Archive & move the file

I have a set of files in path /ifx01/etldata/lmt/ a.xml b.xml I have to archive & move these files to path /ifx01/etldata/archive ,so that not even the original files should exists. After acrhiving there should be no files in path /ifx01/etldata/lmt/ (6 Replies)
Discussion started by: jagadeeshn04
6 Replies

8. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

9. Shell Programming and Scripting

Download previous day files through FTP

Hi All, I have a scenario where I need to download the previous day modified files from other server to my server through FTP . Could any one please send me the shell script for the same. I used the following but I dont know how to proceed after this. ftp -n -i -v $IP <<ENDOFinPUT >>... (3 Replies)
Discussion started by: sarathchandrach
3 Replies
Login or Register to Ask a Question