[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: Last modified files with owner / time / permissions
From:       "Archimerged Ark Submedes" <archimerged () gmail ! com>
Date:       2008-09-18 16:40:14
Message-ID: 5ba4bef00809180940k47fefb84ycea216b0734f97c0 () mail ! gmail ! com
[Download RAW message or body]

On Wed, Sep 10, 2008 at 3:11 PM, lexton <tim.binary@gmail.com> wrote:
> ... bash script that prints out the files that have been modified in
> the last 5 days ...

Try this:

#!/bin/bash
# note run above line with -x for debug mode
export PATH=/usr/bin:/bin
FILENAMECOLUMN=8 # 9 on old systems or if LC_TIME=posix.
WEBSITES=/websites/path
{ # disk space left
 df -h
 printf "\n----\n"
 # last logins to system
 last
 # last 5 days of file modications sorted by the file path.
 printf "\n---- Last 5 Days (all depths) ----\n"
 find "$WEBSITES" -daystart -type f -mtime -5 -print0 |
   xargs -0 --no-run-if-empty ls -l |
   sort -k $FILENAMECOLUMN
# all level 1 files sorted by modification time
 printf "\n---- Full List ----\n"
 ls -lt "$WEBSITES"/*
} | mail -s 'dev info' mail@mail.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic