Hi there,
I'm from an IT background and have recently taken on the responsibility of maintaining and administering Red Hat Critical servers. I have no experience in a Linux/Unix environment and all I know is self taught - treat me as a novice please.
I need to search to do the following:
1. Scan my FTP server for content 6 months or older;
2. Exclude 2 Directories from the find command;
3. Create a text file with it's findings and save it with the date and time as the name
4. Attach that file created and mail it out.
I've so far managed to do Steps 1, 3 & 4. I cannot seem to exclude Directories.
Also, despite the text files being created and attached, they are blank in the email but not in the directory they are created. Also, it only attaches the file from the location the file is created.
This command is to be put into a script so in theory it has to run from anywhere and not from within the folder - kind of defeat's my ambition and task here.
Here is what I managed to come up with:
find /ftp_mount/ftp_root/ -ctime +180 > /usr/bin/FTPpurgefiles/logs/ShowContent/ShowContent_`date "+%d-%m-%Y_%H-%M-%S"`.txt | mutt -s "Log" -a /usr/bin/FTPpurgefiles/logs/ShowContent/`ls -tr | tail -n 1`
mail@me.com
If any genius out there can help with this, I'll send you a ton of Virtual Beer
Thanks in advance