Sponsored Content
Top Forums Shell Programming and Scripting How to delete subdirectories that are more than 1 day old AND have NO files on them Post 302540617 by yazu on Thursday 21st of July 2011 07:54:27 AM
Old 07-21-2011
Quote:
is it [ -z "`ls "$d"`" ] ?
Yes.
This User Gave Thanks to yazu For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete files one day old in current month only

i want to delete files that are one day old condition is files should be of current month only ie if iam running script on 1 march it should not delete files of 28 feb(29 if leap year :-)} any modifications to find $DIR -type f -atime +1 -exec rm -f{}\; (4 Replies)
Discussion started by: maverick
4 Replies

2. Shell Programming and Scripting

Not able to delete the files in day wise...

Dear All, I am not able to remove the files in my AIX 5.3 server. My files List /iims-home/data/uat1/batch/staging -rw-r--r-- 1 iims iims 5743 Jun 12 09:04 ErrorReport2008-05-20 09-04-18.doc -rw-r--r-- 1 iims iims 191213683 Jun 12 09:05... (1 Reply)
Discussion started by: bvijaycom
1 Replies

3. Shell Programming and Scripting

How to delete files which more than one Day old?

I have a directory /opt/targets which generates more than 1000 files per day and I want to delete all the files which are more than 1 day old...ie 24hrs+ Please help.. (3 Replies)
Discussion started by: sunilrk07
3 Replies

4. Shell Programming and Scripting

Delete all the files and subdirectories for the year 2006

Hi I have lot of files and subdirectories inside a directory which are created in the years 2006, 2007, 2008, 2009 and 2010. I want to delete all the files and subdirectories belonging to the year 2006 alone. How can I do that ? (5 Replies)
Discussion started by: samsungsamsung
5 Replies

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

6. AIX

Want to delete directory, subdirectories and all files which are older than 7 days

how do i remove sub directories of a directory and all files which are older than 7 days by a single command in AIX. pls help me. I am using command as #find /gpfs1/home/vinod/hpc/ -depth -type d -mtime +7 -exec rm -rf {} \; so i want to delete all sub directories and all files from the... (1 Reply)
Discussion started by: vinodkmpal
1 Replies

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

8. Shell Programming and Scripting

Delete file to day

friends how I can delete files from a directory for the current date? (2 Replies)
Discussion started by: tricampeon81
2 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. UNIX for Beginners Questions & Answers

Delete records that do not belong to that day

i have a requirement to delete records that do not belong to that day. For example in a file that came on July 31st ,2018 there are records that belong to Aug 1st,2018 as well and I want to find and delete those records. I want to delete anything with 01-Aug-2018. I have several files like that. I... (6 Replies)
Discussion started by: Priya
6 Replies
FLEXBACKUP(1)						      General Commands Manual						     FLEXBACKUP(1)

NAME
flexbackup - a flexible backup/archiving tool SYNOPSIS
flexbackup [OPTION] DESCRIPTION
Flexbackup is a perl script front-end to various low-level archiving utilities such as tar, dump/restore, cpio, and others. BACKUP OPTIONS
flexbackup -dir <dir> Backup a directory tree starting from path "path" using level 0 (full). flexbackup -set all Backup all sets defined in flexbackup.conf(5) using level 0 (full). flexbackup -set <tag> Backup a set named "tag" using level 0 (full). The set name is defined in flexbackup.conf(5). flexbackup [...] -level <0-9 | full | differential | incremental> Change backup level to a number "0-9", or one of the symbolic names: "full" (level 0); "differential" (level 1); "incremental" (pre- vious backup level + 1). flexbackup [...] -pkgdelta <rpm | freebsd> Prune backup to files not part of a package or changed from distributed version. flexbackup [...] -wday <0-7> Backup only if the week day matches the input number. Sunday is 0 or 7. flexbackup [...] -pipe Write backup data to stdout rather than file/device. flexbackup [...] -ignore-errors Continue backups even if commands return error status RESTORE OPTIONS
flexbackup -list List files in archive. flexbackup -extract Extract (restore) all files from archive into your current working directory. flexbackup -extract -flist <filelist> Extract (restore) the files listed in text file "filelist" into your current working directory. flexbackup -extract -onefile <filename> Extract (restore) the single file named "filename" into your current working directory. flexbackup -compare Compare the archive with the files in your current working directory. flexbackup -restore Interactive restore (dump type only for now). flexbackup [...] -num <n> Read file number "n" from tape. If not given uses current tape position. flexbackup [...] <archive> If archiving to files rather than a device, use file named "archive" for the list/extract/compare/restore operations. flexbackup [...] -pipe Read backup data from stdin rather than file/device. INDEXING OPTIONS
flexbackup -toc List current device's table of contents. flexbackup -toc all List all known table of contents. flexbackup -toc <key> List table of contents for specific database index key named "key". flexbackup -rmindex all Force delete all database index info. flexbackup -rmindex <key> Force delete specified database tape/dir index key named "key". flexbackup -rmindex <key:file> Force delete specified database tape/dir index key named "key", file number "file". MISCELLANEOUS OPTIONS
flexbackup -newtape Erase and create new index key (but don't do any backups). flexbackup -rmfile all If archiving to files rather than device, remove all files and index information. flexbackup -rmfile <file> If archiving to files rather than device, remove the file named "file" and its index information. flexbackup [...] -c <file.conf> Use file named "file.conf" for configuration information instead of /etc/flexbackup.conf(5). flexbackup [...] -type <type> Override $type setting from config file with "type". flexbackup [...] -compress <type> Override $compress setting from config file with "type". flexbackup [...] -device <device> Override $device setting from config file with "device". flexbackup [...] -d <'setting=value'> Override $setting setting from config file with "value". flexbackup -dir <dir> -erase Force a rewind/erase before backup of directory named "dir". flexbackup -dir <dir> -norewind Do not rewind tape after a single backup of directory named "dir". flexbackup -set <tag> -noreten Do not retension tape for level 0 (full) backups of set named "tag". flexbackup -set <tag> -noerase Do not rewind/erase tape for level 0 (full) backups of set named "tag". flexbackup [...] -reten Force a retension of tape before reading. flexbackup [...] -defaults Do not use any default values for config variables. flexbackup -version Display version and exit. TESTING
/DEBUGGING OPTIONS flexbackup -test-tape-drive Tries writing/reading files to make sure you have tape driver and parameters set up correctly in flexbackup.conf(5). flexbackup [...] -n Don't run actual dump or mt commands, just print the steps that would be taken (dry run). flexbackup [...] -type filelist Run a special backup type that just saves a list of files that would have been archived. FILES
/etc/flexbackup.conf - configuration settings REPORTING BUGS
Report bugs to (flexbackup-help@lists.sourceforge.net) AUTHOR
Written by Edwin Huffstutler (edwinh@computer.org) SEE ALSO
flexbackup.conf(5) afio(1) mt(1) tar(1) star(1) cpio(1) dump(1) restore(1) buffer(1) mbuffer(1) Flexbackup Oct 2003 FLEXBACKUP(1)
All times are GMT -4. The time now is 08:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy