Sponsored Content
Top Forums Shell Programming and Scripting Scripting help for rm log files from multiple dir Post 302119919 by morgadoa on Friday 1st of June 2007 03:10:00 PM
Old 06-01-2007
Scripting help for rm log files from multiple dir

Hi,

I'm quite new to scripting and need some help. I need to have one script that will check specific directories for files older than one month and then have the script delete them.

I have written the script below but it only does one directory. I don't quite know how to make it so it checks other directories as well.

#!/bin/sh

DIR=/export/home/Scripts/Batch/Ds/edsf/archive
export DIR

cd $DIR;/usr/bin/find . -mtime +31 -type f | /usr/bin/xargs rm -rf

Any help would be appreciated.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Scan Multiple Dir/Files

Hi gang, I have a project I would like to work on as I learn perl & ruby scripting. Maybe a big bite to chew off at first, but that's how I like to learn. Attack a real world problem. I would like to enhance our response to spam attacks here at our office where we run mail, dhcp, dns... (7 Replies)
Discussion started by: tonyd
7 Replies

2. Shell Programming and Scripting

Checking the directory and concatenate the data of all the log files in that dir

Hi Gurus, I am new to unix and need your help to make a shell script. I have a requirement, would appreciate if you could please help me on it: Requirement: ------------- I will pass 2 parameters in shell script 1). Directory name say errors 2). file extension say .log First of all this... (4 Replies)
Discussion started by: anshulinpc
4 Replies

3. Shell Programming and Scripting

replace string in multiple files, dir and subdir

Hello, I have a directory www with multiple directories. Every directory has site name with .htm, .html, .php files or sub directories with .htm, .php, .html file as example - www - sitename 1 - site 1 - sitename 2 - sitename 3 What I'm looking for is a... (7 Replies)
Discussion started by: andyjill
7 Replies

4. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

5. Shell Programming and Scripting

find string from multiple dir and redirect to new files

Hi, I am new to script and I want find one string from multiple files in diff directories and put that out put to new file. Like I have A,B & C directories and each has multiple files but one file is unic in all the directories like COMM.txt Now I want write script to find the string... (8 Replies)
Discussion started by: Mahessh123
8 Replies

6. Shell Programming and Scripting

moving files from a dir in one machine to a dir in another machines

Hi, I am a unix newbie.I need to write a shell script to move my oracle READ WRITE datafiles from one serevr to another. I need to move it from /u01/oradata/W1KK/.. to /u01/oradata/W2KK, /u02/oradata/W1KK/.. to /u02/oradata/W2KK. That is, I actaully am moving my datafiles from one database to... (2 Replies)
Discussion started by: mathews
2 Replies

7. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

8. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

9. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies

10. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
GRUB-INSTALL(1) 					      General Commands Manual						   GRUB-INSTALL(1)

NAME
grub-install -- Install GRUB on a device. SYNOPSIS
grub-install [--modules=MODULES] [--install-modules=MODULES] [--themes=THEMES] [--fonts=FONTS] [--locales=LOCALES] [--compress[=no,xz,gz,lzo]] [-d | --directory=DIR] [--grub-mkimage=FILE] [--boot-directory=DIR] [--target=TARGET] [--grub-setup=FILE] [--grub-mkrelpath=FILE] [--grub-probe=FILE] [--allow-floppy] [--recheck] [--force] [--force-file-id] [--disk-module=MODULE] [--no-nvram] [--removable] [--bootloader-id=ID] [--efi-directory=DIR] INSTALL_DEVICE DESCRIPTION
grub-install installs GRUB onto a device. This includes copying GRUB images into the target directory (generally /boot/grub), and on some platforms may also include installing GRUB onto a boot sector. OPTIONS
--modules=MODULES Pre-load modules specified by MODULES. --install-modules=MODULES Install only MODULES and their dependencies. The default is to install all available modules. --themes=THEMES Install THEMES. The default is to install the starfield theme, if available. --fonts=FONTS Install FONTS. The default is to install the unicode font. --locales=LOCALES Install only locales listed in LOCALES. The default is to install all available locales. --compress=no,xz,gz,lzo Compress GRUB files using the specified compression algorithm. --directory=DIR Use images and modules in DIR. --grub-mkimage=FILE Use FILE as grub-mkimage. The default is /usr/bin/grub-mkimage. --boot-directory=DIR Use DIR as the boot directory. The default is /boot. GRUB will put its files in a subdirectory of this directory named grub. --target=TARGET Install GRUB for TARGET platform. The default is the platform grub-install is running on. --grub-setup=FILE Use FILE as grub-setup. The default is /usr/bin/grub-setup. --grub-mkrelpath=FILE Use FILE as grub-mkrelpath. The default is /usr/bin/grub-mkrelpath. --grub-probe=FILE Use FILE as grub-probe. The default is /usr/bin/grub-mkrelpath. --allow-floppy Make the device also bootable as a floppy. This option is the default for /dev/fdX devices. Some BIOSes will not boot images cre- ated with this option. --recheck Delete any existing device map and create a new one if necessary. --force Install even if problems are detected. --force-file-id Use identifier file even if UUID is available. --disk-module=MODULE Use MODULE for disk access. This allows you to manually specify either biosdisk or native disk access. This option is only avail- able on the BIOS target platform. --no-nvram Do not update the boot-device NVRAM variable. This option is only available on IEEE1275 target platforms. --removable Treat the target device as if it is removeable. This option is only available on the EFI target platform. --bootloader-id=ID Use ID as the bootloader ID. This opption is only available on the EFI target platform. --efi-directory=DIR Use DIR as the EFI System Partition root. This opption is only available on the EFI ta rget platform. INSTALL_DEVICE Install GRUB to the block device INSTALL_DEVICE. SEE ALSO
info grub Wed Feb 26 2014 GRUB-INSTALL(1)
All times are GMT -4. The time now is 07:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy