Sponsored Content
Top Forums UNIX for Dummies Questions & Answers List files older that 7 days in a dir, excluding all subdirs Post 302650795 by jwbijl on Monday 4th of June 2012 09:38:24 AM
Old 06-04-2012
Hi guys,

Works just fine. I tried to remove ./ characters at the beginning of the result with awk:
Code:
|awk 'BEGIN {FS="./"}{print $1}'

but the result is still the same. Any suggestions?

---------- Post updated at 03:38 PM ---------- Previous update was at 03:32 PM ----------

Ah already found it
Code:
| awk 'BEGIN {FS="/"}{print $2}'


Last edited by Scrutinizer; 06-04-2012 at 12:58 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List directory 7 days older

Say folder archive/ contains many folder each created on a day. this folder may contain files. i want to write a script to delete all the folder inside archive/ which are 7 days older. i used the below script for the reason. find archive -mtime +7 -type d -exec rm -r {} \; pls suggest me if... (3 Replies)
Discussion started by: krishnarao
3 Replies

2. Shell Programming and Scripting

substrings from all files incl subdirs into csv with dir names

Greetings! I have multiple files, one per subdirectory, all with the same file name. All subdirectories are one level deep from the main directory. The data in the files is tab delimited between fields and record delimited with a newline. The subdirectory names have the date in the... (5 Replies)
Discussion started by: vtischuk@yahoo.
5 Replies

3. Shell Programming and Scripting

List the files which are older than 7 days

Hi Frnds, I have to list the files which are older than 7 days in the given directory. it should consider only the files and should not show subdirectories. Thanks, Raja (3 Replies)
Discussion started by: smr_rashmy
3 Replies

4. UNIX for Dummies Questions & Answers

Creating tar file for subdirs, excluding one and preserving user info

Hi All, I am not one of the super users / root for AIX 5.3 system. There is a filesystem Say /DIR1 and its has several subdirs in it say SUBDIR1, SUBDIR2, SUBDIR3. Can I create a tar file for all files under DIR1 and SUBDIR1, SUBDIR3. Excluding SIBDIR2? Also how can I preserve... (2 Replies)
Discussion started by: Hangman2
2 Replies

5. Shell Programming and Scripting

Copy files and subdirs from dir to a new dir

Hello Comunity I am trying to make a bash shell script that it copies files and subdirs(with files) to a new dir. I would like the dest_dir to contain only subdirectories with files not other subdirs inside. it called : cpflatdir src_dir dest_dir Pleaze help me! Thank you in... (2 Replies)
Discussion started by: BTKBaaMMM
2 Replies

6. Shell Programming and Scripting

How to tar this dir excluding some files .au?

Hi all, Thanks for previous help. How to include this in script, I need to tar files which are present in /var/spool/cron/crontabs directory (used for crontab) excluding those files which are having extension .au /var/spool/cron/crontabs>>ls -ltr | grep -v .au total 438 -rw------- 1... (11 Replies)
Discussion started by: manalisharmabe
11 Replies

7. Shell Programming and Scripting

Need Help in ksh Script to list files older than 365 days from specified directories

Requirement is to list the files older than 365 days from multiple directories and delete them and log the list of files which are deleted to a log file. so 1 script should only list files older than 365 days for each directory separately to a folder The other script should read these files... (7 Replies)
Discussion started by: prasadn
7 Replies

8. Shell Programming and Scripting

List and Delete Files which are older than 7 days, but have white spaces in file name

I need to list and delete all files in current older which are olderthan 7 days. But my file names have white spaces. Before deleting I want to list all the files, so that I can verify.find . -type f -mtime +7 | xargs ls -l {} But the ls command is the working on the files which have white... (16 Replies)
Discussion started by: karumudi7
16 Replies

9. Shell Programming and Scripting

List files older than 10 days.

Hello all, I want to list the files older than 10 days. Currently am using find ./ -mtime +10 -exec ls -ltr {} \; command. But I want to execute the same command in 16 directories at a time and want an output asking to remove those file? Please help me to design the script. regards, Ajay (3 Replies)
Discussion started by: 02Ajay
3 Replies

10. Shell Programming and Scripting

How can i move folders and its content if folder is older than 1,5 days and keep subdirs in bash?

Hello all, do you know any way i can i move folders and its content if folder is older than 1,5 days in bash? I tried: find /home/xyz/DATA/* -type d -ctime +1.5 -exec mv "{}" /home/xyz/move_data_here/ \;All i got was that Files from DATA /home/xyz/DATA/* ended messed up in... (1 Reply)
Discussion started by: ZerO13
1 Replies
check_backuppc(8)					      System Manager's Manual						 check_backuppc(8)

NAME
check_backuppc - A Nagios plugin to monitor BackupPC SYNOPSIS
check_backuppc [options] DESCRIPTION
check_backuppc is a nagios plugin that reports on the status of BackupPC. By default, it monitors both archive and backup hosts for errors. OPTIONS
-a, --archive-only Only check the status of archive hosts. -b, --backup-only Only check the status of non-archive hosts. -s, --status-only Only check the status of the backups, omit connection failures that are less than $Conf{FullPeriod} old. -H, --hostname hostname Only check the specified host. Uses hostnames that BackupPC is configured to use, can be specified multiple times. -x, --exclude hostname Do not check the specified host. Uses hostnames that BackupPC is configured to use, can be specified multiple times. -w, --warning age The days old at which a failure is considered a warning, default 1. -c, --critical age The days old at which a failure is considered critical, default 8. -r, --reduce count The maximum number of failed hosts for which to reduce reported severity, default 0. -h, --help Show summary of options. NOTES
This plugin must be run on the same host and as the same user as BackupPC. An archive host only takes on a reported type of archive after its first archive run. EXAMPLES
/usr/local/lib/nagios/plugins/check_backuppc -r1 -w3 -c8 -b -x otter Check the status of all backup hosts except "otter". Warn if a failed backup is older than three days old, return critical if a failure is older than eight days old unless there is only a single failure. In that case, warn if the single failed backup is older than eight days. AUTHOR
Seneca Cunningham <tetragon@users.sourceforge.net> SEE ALSO
sudo(8). backuppc(8). check_backuppc(8)
All times are GMT -4. The time now is 05:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy