- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Sftp exclude file transfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Mark
I changed "find" command in nicsftpagent.sh from
find . $FILESPEC -type f -print | awk 'BEGIN{FS="/"} {print $2}' | while read i
to
find . -maxdepth 1 -regex "$FILESPEC" -type f -print | awk 'BEGIN{FS="/"} {print $2}' | while read i
and in nicsftpagent.conf I use something like that
FILESPEC="\./\(mail\.log\|boot\.log\|access.*\)"
thats mean we look for files mail.log boot.log and access.*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
In the latest version of the nicsftpagent.sh script (v2.7.11) it is noted that FILESPEC can contain multiple items, separated by colons.
## Enter the file matching specification. "*" will send any files in the directory. Separate
## multiple fielnames with a colon (:).
## Example for multiple files::
## FILESPEC=*.log:xyz.log
The code has been re-written to process the FILESPEC as an array.
for i in `echo "$FILESPEC" | awk '{split($0, a, ":"); for (k in a) print a |
I've never seen a README file showing how the script has changed or evolved, I've taken to downloading it now and then and diff'ing versions to see what's changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
But only in one directory, what about when you have to grab logs from different folders ?
/var/log1/app1/access.log
/var/log2/app2/apache.*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
v2.7.11 also supports multiple directories. The script appears to walk each directory for each FILESPEC, which could create some interesting situations when you have multiple entries in both.
## Enter the directories where the data files, which you need to send, exist. Separate
## multiple directories with a colon (:). This script must have read permissions
## to the directories.
## Example for multiple folders DATA_DIRECTORY=/var/log/:/var/log/audit
DATA_DIRECTORY=/var/log/
The PDF the describes the script hasn't been updated since 2010, so you pretty much have to browse the script with each new revision to find these additions...
