On Wed, Sep 10, 2008 at 3:11 PM, lexton <[EMAIL PROTECTED]> 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' [EMAIL PROTECTED]