Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to remove zip files from a directory Post 302849851 by punpun66 on Tuesday 3rd of September 2013 12:47:59 PM
Old 09-03-2013
Wrench Script to remove zip files from a directory

Hi Folks,

There is a job which generates a .zip files every day at
Code:
/usr/app/generated

directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this script should run on 25 date of every month, so for example let say on 25 sept 2013 it will remove all zip files excluding zip of 25 and 24 sept 2013Smilie

Last edited by vbe; 09-03-2013 at 01:54 PM.. Reason: code tags .. not PHP
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to remove all empty files within the directory structure?

Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted. I've be... (5 Replies)
Discussion started by: cat123
5 Replies

2. Shell Programming and Scripting

Zip all files in a directory

I have two files in a directory: xxxx.txt xxxx.csv I need to zip both files up but the command I am doing below is only zipping xxx.txt file????: cd ../$CUSTOMER_DIRECTORY zip -q ${name}${FILE_OUT_NAME}.zip ls -lrt *.csv *.txt can anyone help?:confused: (3 Replies)
Discussion started by: Pablo_beezo
3 Replies

3. Shell Programming and Scripting

batch shell script to zip individual files in directory - help

help trying to figure out a batch shell script to zip each file in a directory into its own zip file using this code but it does not work tryed this also nothing seems to work , just ends without zipping any files i have over 3000 files i need to zip up individualy ... (7 Replies)
Discussion started by: wingchun22
7 Replies

4. Shell Programming and Scripting

Script That Can navigate to 3 differents directory & remove files under them

Hi I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ?? /logs logs1 logs2 logs3 Now I need to remove files under logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' . in... (3 Replies)
Discussion started by: Beginner123
3 Replies

5. UNIX for Dummies Questions & Answers

Zip files inside the directory, but not the directory itself

Hi, Im facing a problem that im stucked, I have the following structure: thales@pereirtc-vbox:/home/VfARM$ ls code config doc lib manifest.bak manifest.rel manifest.v3 ns pub if i try to execute zip -q -o arm.zip VfARM/* it will create a zip file with the folder VfARM.... (2 Replies)
Discussion started by: Thales.Claro
2 Replies

6. Shell Programming and Scripting

Need script to remove millions of tmp files in /html/cache/ directory

Hello, I just saw that on my vps (centOS) my oscommerce with a seo script has created millions of tmp files inside the /html/cache/ directory. I would need to remove all those files (millions), I tried via shell but the vps loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies

7. Shell Programming and Scripting

Script to search for a character in files in a Directory & remove it

Hi All, Am new to both Unix & this Forum - Need some help on a script that I am trying to write: In a Directory i have few text files which might or might not contain some text that I am trying to find. Once that text is found in any of the files, it needs to be removed from the file ... (6 Replies)
Discussion started by: rituparna_gupta
6 Replies

8. UNIX for Dummies Questions & Answers

Zip all files in a directory and move to another directory

Hi, need to zip all files in a directory and move to another directory after the zip.. i am using this one but didnt help me... zip -r my_proj_`date +%Y%m%d%H%MS`.zip /path/my_proj mv in_proj_`date +%Y%m%d%H%M%S`.zip /path/source/ i am trying to zip all the files in my_proj... (0 Replies)
Discussion started by: dssyadav
0 Replies

9. Shell Programming and Scripting

Append string to all the files inside a directory excluding subdirectories and .zip files

Hii, Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories. Eg. file1: test1.log file2: test2.log file3 test.zip After running the script file1: string_test1.log file2: string_test2.log file3:... (4 Replies)
Discussion started by: Ravi Kishore
4 Replies

10. UNIX for Beginners Questions & Answers

How to zip csv files having specific pattern in a directory using UNIX shell script?

I have files in a Linux directory . Some of the file is listed below -rw-rw-r--. 1 roots roots 0 Dec 23 02:17 zzz_123_00000_A_1.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_121_00000_A_2.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_124_00000_A_3.csv drwxrwxr-x. 2 roots roots 6 Dec 23... (4 Replies)
Discussion started by: Balraj
4 Replies
LIBZIP(3)						     Library Functions Manual							 LIBZIP(3)

NAME
libzip - library for manipulating zip archives LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> DESCRIPTION
libzip is a library for reading, creating, and modifying zip archives. Below there are two sections listing functions: one for how to read from zip archives and one for how to create/modify them. READING ZIP ARCHIVES
open archive zip_open(3) zip_fdopen(3) find files zip_name_locate(3) read files zip_fopen(3) zip_fopen_encrypted(3) zip_fopen_index(3) zip_fopen_index_encrypted(3) zip_fread(3) zip_fclose(3) close archive zip_close(3) miscellaneous zip_stat(3) zip_get_archive_comment(3) zip_get_archive_flag(3) zip_get_file_comment(3) zip_get_name(3) zip_get_num_entries(3) zip_set_default_password(3) CREATING
/MODIFYING ZIP ARCHIVES create/open archive zip_open(3) add/change files and directories zip_add(3) zip_add_dir(3) zip_replace(3) zip_set_file_comment(3) zip_source_buffer(3) zip_source_file(3) zip_source_filep(3) zip_source_function(3) zip_source_zip(3) zip_source_free(3) rename files zip_rename(3) delete files zip_delete(3) revert changes zip_unchange(3) zip_unchange_all(3) zip_unchange_archive(3) close archive zip_close(3) miscellaneous zip_set_archive_comment(3) zip_set_archive_flag(3) ERROR HANDLING
zip_error_to_str(3) zip_strerror(3) zip_file_strerror(3) zip_error_get(3) zip_error_get_sys_type(3) zip_errors(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH February 14, 2011 LIBZIP(3)
All times are GMT -4. The time now is 06:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy