[alexsystem ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda2 121896960 227651 121669309 1% /
/dev/hda1 26104 44 26060 1% /boot
tmpfs 64417 1 64416 1% /dev/shm
find . -mindepth 2 | awk -F/ '{ print $2"/" }' | sort | uniq -c | sort -n | tail -10
https://linux.die.net/man/1/ftpmail
ftpmail(1) - Linux man page
Name
ftpmail - FIFO-based Perl script for sending email based on proftpd TransferLog
Synopsis
ftpmail [ --help ] [ --fifo fifo-path ] [ --from email-address ] [ --log xferlog-file ] [ --recipient email-address ] [ --subject email-subject ] [ --smtp-server server-address ] [ --attach-file ] [ --auth smtp-auth-info-file ] [ --ignore-users regex-pattern ] [ --watch-users regex-pattern ]
Description
ftpmail is a Perl script designed to read ProFTPD's TransferLog log entries, watching for uploads, and to send an automatic email notification when uploads occur. To use ftpmail , you configure your proftpd daemon to write its TransferLog to a FIFO; the ftpmail program is a FIFO reading program which then processes those log messages.
https://github.com/proftpd/proftpd/blob/master/contrib/ftpmail
#!/usr/bin/env perl
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2017 TJ Saunders <tj@castaglia.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
# ---------------------------------------------------------------------------
use strict;
use File::Basename qw(basename);
use Getopt::Long;
use Mail::Sendmail;
use MIME::Base64 qw(encode_base64);
use Time::HiRes qw(usleep);
my $program = basename($0);
my $opts = {};
GetOptions($opts, 'attach-file', 'fifo=s', 'from=s', 'help', 'ignore-users=s',
'log=s', 'recipient=s@', 'upload-recipient=s@', 'download-recipient=s@',
'sleep=s', 'smtp-server=s', 'subject=s', 'watch-users=s', 'auth=s');
...
Пример #1 Содержимое sample.ini
; Это пример файла настроек
; Комментарии начинаются с ';', как в php.ini
[first_section]
one = 1
five = 5
animal = BIRD
[second_section]
path = "/usr/local/bin"
URL = "http://www.example.com/~username"
[third_section]
phpversion[] = "5.0"
phpversion[] = "5.1"
phpversion[] = "5.2"
phpversion[] = "5.3"
urls[svn] = "http://svn.php.net"
urls[git] = "http://git.php.net"
Пример #2 Пример использования функции parse_ini_file()
Константы также могут обрабатываться в ini-файлах, так что если вы объявите константу в виде значения для ini-файла до вызова parse_ini_file(), то константа будет корректно обработана. Таким образом обрабатываются только значения опций. Например:
// startuid.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
int main(void)
{
pid_t child_pid;
printf("Real UID\t= %d\n", getuid());
printf("Effective UID\t= %d\n", geteuid());
printf("Real GID\t= %d\n", getgid());
printf("Effective GID\t= %d\n", getegid());
if((child_pid = fork()) < 0 )
{
perror("fork failure");
exit(1);
}
if(child_pid == 0)
{
execl("/bin/ls", "ls", "-l", "/root", (char*)0);
perror("execl() failure!\n\n");
_exit(1);
}
return EXIT_SUCCESS;
}
[Unix]# ls -l
-rwxr-xr-x 1 root root 7348 Jul 2 18:19 startuid
[Unix]# chmod u+s startuid
[Unix]# ls -l
-rwsr-xr-x 1 root root 7348 Jul 2 18:19 startuid
wget -qO- http://192.168.240.47/ussdkstregexp.txt
wget -qO- http://192.168.240.47/ussdkstregexp.txt | next_command