bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Last modified files with owner / time / permissions


From: Archimerged Ark Submedes
Subject: Re: Last modified files with owner / time / permissions
Date: Thu, 18 Sep 2008 12:40:14 -0400

On Wed, Sep 10, 2008 at 3:11 PM, lexton <address@hidden> 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' address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]