Sponsored Content
Full Discussion: Missing conjunction
Top Forums Shell Programming and Scripting Missing conjunction Post 302482131 by methyl on Monday 20th of December 2010 05:05:25 PM
Old 12-20-2010
Quote:
between 7 and 14 days
Quote:
find . -name "*.bin" -type f -mtime +$file_arch_st_time -mtime -$file_arch_end_time

It may be that this boolean version will produce the desired range. The specification is still ambiguous but I think that we are homing in on the solution!
The problem with the original "find" parameters is that the second "-mtime" takes precedent over the first "-mtime".

Code:
find . -name "*.bin" -type f \( -mtime +$file_arch_st_time -a -mtime -$file_arch_end_time \)

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what am I missing?

I have the following portion of a script Check() { echo "\n\nChecking that all constraints are Enabled" echo "..." sleep 2 CHECK_COUNT='sqlplus -s $1 <<-EOSQL4 set feed off pause off pages 0 head off; set linesize 150 echo off; select count(*) from user_constraints where... (4 Replies)
Discussion started by: Zelp
4 Replies

2. UNIX for Dummies Questions & Answers

Missing Package

Hi All, I have a server running SunOS 5.9, on this I need to install Oracle 10g; however the installer returns ERROR: Unable to convert from "UTF-8" to "646" for NLS! Did some digging around and found that I need the SUNWuiu8 package. However I'm not sure where I can download the... (1 Reply)
Discussion started by: Zak
1 Replies

3. Shell Programming and Scripting

conjunction two files

I need to your help. I want write a script search for rows in file1 if exist in file2 it will print rows from file2 else it will print rows from file1 with out any duplicate ... (4 Replies)
Discussion started by: kmuqalled
4 Replies

4. Shell Programming and Scripting

How to go about Using a "Validate an IP script" in conjunction with Logfile?

Hi, so I have been trying to write a shell script to go through a log file and through that, generate another file with all the Valid IP addresses it finds. So there's the complication that there could be incomplete or invalid data which would disqualify it from making my "Valid IPs" file I need... (3 Replies)
Discussion started by: shellcow
3 Replies

5. Shell Programming and Scripting

Problem with date in conjunction with cut?

I got rather bored so i decided to create a script that creates a countdown, and shows hours:minutes:seconds till that time. It works fine until the seconds of the actual time reaches 8, then it tries to use it to work out the difference as in "SECONDDIFF=$" Here's my code where I get the... (12 Replies)
Discussion started by: DuskFall
12 Replies

6. Shell Programming and Scripting

[: missing `]'

Hi, I am getting this error while running the following code. i=`awk '{print $2}' test1.txt` j=`awk '{print $4}' test1.txt` k=`awk '{print $6}' test1.txt` if ; then echo "Up." else echo "down" fi rm -f test.txt test1.txt error is this: line 12: ' Please suggest. (2 Replies)
Discussion started by: arijitsaha
2 Replies

7. UNIX for Dummies Questions & Answers

Nohup in conjunction with time

hi, if I exectute "nohup time ls -1" I get the following output $ nohup time ls -1 file_1 file_2 file_3 file_4 file_5 0.000u 0.001s 0:00.00 0.0% 0+0k 0+0io 0pf+0w This is all OK. But if I want to capture this whole output in to a text file I would want to use something like ... (1 Reply)
Discussion started by: BearCheese
1 Replies

8. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

9. Red Hat

Yum - resolving missing dependencies that are not missing

I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following: sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm Loaded plugins: fastestmirror Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies
SHTOOL-ROTATE.TMP(1)					      GNU Portable Shell Tool					      SHTOOL-ROTATE.TMP(1)

NAME
shtool-rotate - GNU shtool log file rotation SYNOPSIS
shtool rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files count] [-s|--size size] [-c|--copy] [-r|--remove] [-a|--archive-dir dir] [-z|--compress [tool:]level] [-b|--background] [-d|--delay] [-p|--pad len] [-m|--mode mode] [-o|--owner owner] [-g|--group group] [-M|--migrate cmd] [-P|--prolog cmd] [-E|--epilog cmd] file [file ...] DESCRIPTION
This command rotates a logfile file by subsequently creating up to count (optionally compressed) archive files of it. Archive files are named "file.number[compress-suffix]" where number is the version number, 0 being the newest and "count-1" the oldest. A rotation step consists of the following steps 1. remove last archive file 2. shift archive file numbers 3. create archive file 0 from file 4. truncate/recreate file OPTIONS
The following command line options are available. -v, --verbose Display some processing information. -t, --trace Enable the output of the essential shell commands which are executed. -f, --force Force silent creation of archive directory if it does not exists. Also skip missing intermediate logfiles in the rotation step. Default is to exit with error in both cases. FIXME -n, --num-files count Create count archive files. Default is 10. -s, --size size Only rotate if logfile exceeds size. The argument size can be specified also with the trailing units "K" (kilo), "M" (mega) or "G" (giga). The "prolog" and "epilog" are only executed if rotation actually takes place. -c, --copy Copy file to archive then truncate original. The default is to move file to archive. Unless an application reopens its logfile it will continue to write to the same file. In the default move case the application will write to the archive which it had previously opened as file. In the copy case the application will write to the original file. The drawback of the copy approach is that logfile entries are lost when they are written to file between the execution of the copy and the truncation operation. The drawback of the move approach is that the application needs to detect the move or must be triggered to reopen its log (i.e. through epilog). -r, --remove Removes file after rotation instead of providing a new empty file. -a, --archive-dir dir Specify the archive directory. Default is to create archives in the same directory as file is located. -z, --compress [tool:]level Enables compression of archive files with compression level level By default, the tools bzip2(1), gzip(1) and compress(1) are searched for in $PATH, but one also can override this by prefixing the compression level with one of the three particular tool names. -b, --background Enable background compression. -d, --delay Delays the compression of archive file number 0. This is useful if ``-c'' is not used, because an application might continue to write to archive file 0 through an already open file handle. -p, --pad len Enables padding with leading zeros in the number part of the filename "file.numbercompress-suffix". The default padding len is 1. This is interesting if more than 10 archive files are used, because it leads to still sorted directory listings. -m, --mode mode The file mode applied to the created files, see chmod(1). Setting mode to "-" skips this step and leaves the operating system default which is usually based on umask(1). Some file modes require superuser privileges to be set. Default is 0755. -o, --owner owner The file owner name or id applied to the created files, see chown(1). This option requires superuser privileges to execute. Default is to skip this step and leave the operating system default which is usually based on the executing uid or the parent setuid directory. -g, --group group The file group name or id applied to the created files, see chgrp(1). This option requires superuser privileges to execute to the fullest extend, otherwise the choice of group is limited on most operating systems. Default is to skip this step and leave the operating system default which is usually based on the executing gid or the parent setgid directory. -M, --migrate cmd Execute a "migration" command just before the archive file number count-1 is removed from the filesystem. The specified cmd receives the archive filename as command line argument. -P, --prolog cmd Execute a "prolog" command before the rotation step. Useful in conjunction with -s. -E, --epilog cmd Execute a "epilog" command after the rotation step. Useful in conjunction with -s. EXAMPLE
# shell script shtool rotate -n10 -s1M -zbzip2:9 -d -r /var/log/ap.access.log shtool rotate -n5 -s128K -zbzip2:9 -d -r /var/log/ap.error.log apachectl graceful HISTORY
The GNU shtool rotate command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. Its development was prompted by the need to have a flexible logfile rotation facility in the OpenPKG project. SEE ALSO
shtool(1), BSD newsyslog(8). 18-Jul-2008 shtool 2.0.8 SHTOOL-ROTATE.TMP(1)
All times are GMT -4. The time now is 01:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy