Sponsored Content
Full Discussion: Skip files in use
Top Forums UNIX for Advanced & Expert Users Skip files in use Post 302693483 by charli1 on Wednesday 29th of August 2012 09:22:44 AM
Old 08-29-2012
Skip files in use

Hi all,
i'm trying to configure a script that will find and gzip the searched files,
this is easy enough,
Code:
find /var/log/myfolder/*.log -type f -mtime +1 -exec gzip {} \;
cd /var/log/myfolder/
mv *gz myzipped_folder/

but what it would be very handy is to skip the files in use,because tomcat its going to check for some file that my script have gziped and move and alerting me by email for not enough space on HDD,when in reality there is enough,
you may suggests why don't you simply restart Tomcat,well i cant do that,to many jobs running 24h to 24h,so is any way to implement on my script the option skip files in use by Tomcat?

Thanks in advance
Charli.
 

10 More Discussions You Might Find Interesting

1. BSD

FreeBSD skip UserConfig...

When I boot FreeBSD from cd/floppy, it skips the UserConfig program. I have no idea why! And if I skip this step, my hardware won't work. ( I already tried...) Can anyone help me with this??? (2 Replies)
Discussion started by: Enoch Chan
2 Replies

2. Shell Programming and Scripting

Skip new line

Hi, how can I skip the new line of echo? In SH!!!! echo "the date is :" date and result I want is the date is : Tue Oct 11 22:24:37 WEST 2005 I've already tried including the \c inside the echo, but it didn't work. Thanks! (2 Replies)
Discussion started by: pmpx
2 Replies

3. SuSE

skip upgrading rpm

hi the step 'upgrading the rpm' is taking a long tme. and since I am not interested in uninstallation, is there a way to skip this step? thx (4 Replies)
Discussion started by: melanie_pfefer
4 Replies

4. Shell Programming and Scripting

extract multiple cloumns from multiple files; skip rows and include filenames; awk

Hello, I am trying to write a bash shell script that does the following: 1.Finds all *.txt files within my directory of interest 2. reads each of the files (25 files) one by one (tab-delimited format and have the same data format) 3. skips the first 10 rows of the file 4. extracts and... (4 Replies)
Discussion started by: manishabh
4 Replies

5. Shell Programming and Scripting

go to / skip in script

Hi all I have some script like this #!/bin/bash mv /tmp/file1 tmp/file2 if ] ; then cp /tmp/filetest/ tmp/file3 if ] then echo "succes" else echo "failed" fi else echo "failed" fi i didn't try to see if it's work, the thing is that i don't care if... (4 Replies)
Discussion started by: naamas03
4 Replies

6. Programming

How to skip getchar in C?

Hi, I would like to read an input from keyboard using getchar. However, if no input (No Carriage return/new line none whatsoever) is given after say, 5 seconds, I would like to skip the getchar and move on. How do I do this in C. I'm using GNU compiler set. Thanks, (5 Replies)
Discussion started by: cprogdude
5 Replies

7. Shell Programming and Scripting

Skip first and last n records with awk

Hi, I have an awk code that reads an input file, checks the 4th column and tells if its fine. #!/bin/ksh { if ($4 == 0) print "fine" else print "some problem" }' FILENAME My problem is that, I dont want to check the first 3 and last 3 lines. This can be hard coded by using BEGIN and END... (9 Replies)
Discussion started by: gotam
9 Replies

8. Shell Programming and Scripting

How to skip copying some types of files in csh

Hi, I want to copy data from one directory to another in csh script. But in that i want to skip certain types of file. How can i do that. Currently i am copying all the files as mentioned below.. foreach d ( $TEST_PATH/*) cp -R $d $PWD end now i want to skip files... (3 Replies)
Discussion started by: vdhingra123
3 Replies

9. Shell Programming and Scripting

Skip first and last line

Hi All I have a sample file like below: 012312112 1372422843 1236712 1372422843 1275127 3109301010 from which I wan't to: 1.)delete... (10 Replies)
Discussion started by: swasid
10 Replies

10. Shell Programming and Scripting

Can I skip files when running rm command

Platform: Oracle Enterprise Linux 6.2 I have several files like below. I want to remove all files except one file For example , I want to remove all the files below except dasd_91197.trc $ ls -alrt *.trc -rw-r----- 1 ecmdev wms 8438784 May 7 21:30 dasd_91177.trc -rw-r----- 1 ecmdev wms ... (3 Replies)
Discussion started by: John K
3 Replies
DH_CLEAN(1)							     Debhelper							       DH_CLEAN(1)

NAME
dh_clean - clean up package build directories SYNOPSIS
dh_clean [debhelperoptions] [-k] [-d] [-Xitem] [file...] DESCRIPTION
dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some other files including debian/files, and any detritus left behind by other debhelper commands. It also removes common files that should not appear in a Debian diff: #*# *~ DEADJOE *.orig *.rej *.SUMS TAGS .deps/* *.P *-stamp It does not run "make clean" to clean up after the build process. Use dh_auto_clean(1) to do things like that. dh_clean (or "dh clean") should be the last debhelper command run in the clean target in debian/rules. FILES
debian/clean Can list other files to be removed. OPTIONS
-k, --keep This is deprecated, use dh_prep(1) instead. -d, --dirs-only Only clean the package build directories, do not clean up any other files at all. -Xitem --exclude=item Exclude files that contain item anywhere in their filename from being deleted, even if they would normally be deleted. You may use this option multiple times to build up a list of things to exclude. file ... Delete these files too. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 9.20120909 2011-10-19 DH_CLEAN(1)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy