Sponsored Content
Top Forums Shell Programming and Scripting script to compress files in directory that changes its name every day Post 302613963 by rbatte1 on Wednesday 28th of March 2012 05:12:15 AM
Old 03-28-2012
You will need to tweak your find command a little. You are currently looking in the directories given by expanding /u01/easydone/DBDUMPS/*.dmp but I fancy that actually your files are called *.dmp

What you need is something more like this:-
Code:
find /u01/easydone/DBDUMPS -type f -name "*.dmp" -mtime +2 -exec gzip {} \;

The explanation is:-
  1. Start searching from /u01/easydone/DBDUMPS
  2. Find only files
  3. Only match files that are in the format *.dmp (use " to prevent expansion on the command line)
  4. Only match files that were last updated over two days ago
  5. For each match, execute the gzip command with the file as a parameter.

I hope that this helps. If you have sub-mounted filesystems that you do not want to search or there could be symbolic links that you don't want to follow off to other filesystems, use the -xdev flag too (see the man page for info)



Robin
Liverpool/Blackburn, UK
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to compress a directory on a Sun Solaris 5.7 ?

Hi, Is there any utility to compress an entire directory on a Sun Solaris 5.7 ? Something like "compressdir" on other flavours of Unix ? Thanks (4 Replies)
Discussion started by: sameerdes
4 Replies

2. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies

3. Shell Programming and Scripting

How to Compress files before moving them in a directory

I need a shell script that zips a file before moving them..please help (3 Replies)
Discussion started by: godalle
3 Replies

4. Shell Programming and Scripting

compress Directory

Hi Friends, I have a directory under which 10 more directories are there. In each 10 directories there are several files. I want to do FTP. But in FTP we cannt Transfer the main directory. each Time we have to go to the respective directry and then we have to to FTP. For this instance I... (9 Replies)
Discussion started by: deep_kol
9 Replies

5. Shell Programming and Scripting

Archive directory script with tar/compress

Hi all I need to write a script that archives all files with a certain date in the filename, to another location. It has to run on a AIX using tar/compress or another standard AIX tool. The directory will have x files, each prefixed with a date like yyyymmdd_desc.csv. I need all to... (7 Replies)
Discussion started by: AIXfrog
7 Replies

6. Shell Programming and Scripting

Help - compress file one day ago

Hi All, I'm a new member of this Forum. I have need your help to handle this request. "Compress a file name not of today but of yesterday only". For example 0 mar 08:00 TEST_RPT_STATUS_M1I_CMI20120320.xls 20 mar 08:00 TEST_RPT_STATUS_M1I_CMI20120320.rep 21 mar 08:00... (6 Replies)
Discussion started by: gio123bgg
6 Replies

7. 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

8. Shell Programming and Scripting

Help on a script to push files once a day

Hello! Please I need some help on writing a script to push files from one server to the other once a day, everyday. I know that I can use this script on a crontab to send the files , but I am not sure how to start writing it, the actual script. I could start by declaring some variables: ... (4 Replies)
Discussion started by: fretagi
4 Replies

9. UNIX for Dummies Questions & Answers

How do I compress all files in a directory?

the problem states "Write a script that compresses all the files in the directory. Make a directory and put some files in it. Also make a sub directory in your directory and put files in it also. Once you have this basic ability to compress all files within a directory, add to your script a menu of... (1 Reply)
Discussion started by: Brittany
1 Replies

10. Shell Programming and Scripting

Help - To copy and compress files one day ago

Hi dears, Hi All, I'm a new member of this Forum. I have need your help to handle this request. "I want to copy and Compress files not of today but of yesterday only using some script". For example I have the following files under a particular directory in a Solaris machine. ... (7 Replies)
Discussion started by: JackyJohn
7 Replies
vxdmp(7)						 Miscellaneous Information Manual						  vxdmp(7)

NAME
vxdmp - Veritas Volume Manager multipathing disk devices DESCRIPTION
Multipathed disk devices in Veritas Volume Manager (VxVM) represent virtual devices with one or more physical access paths to a physical disk. The Multipathing feature provides disk access reliability by dynamically switching to another physical path if there is a path fail- ure. Every disk that is visible to VxVM is represented by a multipath device node in the /dev/vx/dmp and /dev/vx/rdmp directories for block type and character type interfaces. A simple disk is represented by a multipath device having one physical path, whereas a disk that is part of a multiported disk array is represented by a multipath device with many device access paths depending upon the type of the disk array. VxVM uses standard disk device naming conventions to name multipath devices. For example, if there is a disk device with two physical access paths such as c1t0d0 and c2t0d0, the multipathing device node for this particular disk is created under /dev/vx/dmp and /dev/vx/rdmp as c1t0d0 or c2t0d0. To provide multipathing, VxVM maintains an internal database of all the multipathed devices detected by the system and their respective paths. The database is created at system boot time. When disks are added or removed from the system, VxVM provides support to reconfigure the multipath device database to reflect new states of the hardware, while the system is online. To reconfigure the DMP database, run ioscan followed by insf, and then invoke vxdctl enable (see vxdctl(1M)). The various access paths to a multipathed device can be seen by using a vxdisk command (see vxdisk(1M)). These commands open the multi- pathing configuration device /dev/vx/dmpconfig to obtain the required information about the various paths to a multipathed device and their states. VxVM also provides the facility to enable or disable a disk controller. This feature can be used to stop all I/Os through a particular con- troller to perform maintenance operations on it. Use the vxdmpadm command to do this and also perform other operations on the multipath device database. VxVM can provide notification about events that occur in the DMP database due to a change in hardware. See the vxnotify(1M) man page for more information. VxVM is capable of multipathing both Active/Active and Active/Passive disk arrays. FILES
/dev/vx/dmp Multipathing block devices. /dev/vx/rdmp Multipathing character devices. SEE ALSO
ioctl(2), vxdctl(1M), vxdisk(1M), vxdmpadm(1M), vxnotify(1M) VxVM 5.0.31.1 24 Mar 2008 vxdmp(7)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy