Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script that will Delete and Maintain Files Post 302586157 by joeyg on Friday 30th of December 2011 09:34:24 AM
Old 12-30-2011
So, when done, you simply want to make sure that only three log files are kept?

As in, on the 30th the directory would have:
20111228-
20111229-
20111230-

And then on the 31st the directory would have:
20111228-
20111229-
20111230-
20111231-

BUT, you want to get rid of the 20111228- file?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to delete files

hi guys, i need a script to delete files that have core in their name ...it might be part of the file name or as a .core extension ...any file that has core as its extension.... i am only able to delete files which just have thier name as core using this : find $1 -type f -name "core"... (12 Replies)
Discussion started by: vats
12 Replies

2. Shell Programming and Scripting

Maintain full path of a script in a var when sourcing it from a different script

Hi All, I've searched through the forum for a solution to this problem, but I haven't found anything. I have 2 script files that are in different directories. My first script, let's call it "/one/two/a.sh" looks like this: #!/bin/sh IN_DIR=`dirname $0` CUR_DIR=`pwd` cd $IN_DIR... (4 Replies)
Discussion started by: mrbluegreen
4 Replies

3. UNIX for Dummies Questions & Answers

maintain database script...

Hi there. i'm new user at here I need help for this. I need to write a script that maintains a database of cryptographic checksums. In other words, I need this script to check the files checksum whether the files has been modified or not. But i got no idea where to start. Hope anyone here can... (8 Replies)
Discussion started by: hihihehe
8 Replies

4. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

5. Shell Programming and Scripting

Script to delete files

Hi, I am looking for a BASH script that deletes old files except the last three recent ones. (8 Replies)
Discussion started by: newuser_25
8 Replies

6. UNIX for Dummies Questions & Answers

script to delete old files

Hi, I want to delete files that are older than 60 days.... i need to execute the script in 7 differnt folders.... i can run the script in crontab to regularly check.... I am struck @ finding out how the file is 60 days old or not... Can u please help me on this? Thanks, NithZ (6 Replies)
Discussion started by: Nithz
6 Replies

7. Shell Programming and Scripting

Script to maintain file versions

I am developing a script to maintain 'n' number of versions of a file. The script will take a filename as a parameter and the number of versions to maintain. This basically does something like a FIFO. Here is what I developed. But something is not right. I have attached the script. Can u pls help... (2 Replies)
Discussion started by: vskr72
2 Replies

8. Shell Programming and Scripting

Need help creating a script to FTP files to a server and then delete the files that were transfered.

I am trying to FTP files to a Windows server through my Linux machine. I have setup the file transfer with no problems but am having problem deleting those files from the Linux box. My current non-working solution is below. Any ideas, anyone?? :wall: Please be gentle, I'm fairly new to this... (4 Replies)
Discussion started by: jmalfhs
4 Replies

9. Shell Programming and Scripting

Script FTP maintain error handling

Hi, I have ftp script like below How to insert an error handling, If the transfer failed then send mail to me. Actually, I just need the script to send an email if the FTP failed. How to put the email script within FTP script? Thank You Edy (5 Replies)
Discussion started by: edydsuranta
5 Replies

10. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
All times are GMT -4. The time now is 04:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy