run tmpwatch for PHP temp dir

tags/0.0.1_0.fc26_el5
Daniel Berteaud 8 years ago
parent fc4d59c64b
commit 6f64cb8c3f
  1. 2
      createlinks
  2. 1
      root/etc/e-smith/templates.metadata/etc/cron.daily/tmpwatch-php-fpm
  3. 8
      root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/10Defaults
  4. 14
      root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Shares

@ -28,6 +28,8 @@ foreach my $file qw( /etc/php-fpm.conf
safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin");
}
safe_symlink('/etc/e-smith/templates-default/template-begin-shell', 'root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm');
foreach my $file qw( /etc/sysconfig/php-fpm
/opt/remi/php56/root/etc/sysconfig/php-fpm
/etc/opt/remi/php70/sysconfig/php-fpm

@ -0,0 +1,8 @@
for VER in php php56 php70 php71; do
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/tmp
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/opcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/wsdlcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/opcache
done

@ -0,0 +1,14 @@
{
use esmith::AccountsDB;
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n";
foreach my $share ($a->get_all_by_prop(type => 'share')){
next unless (($share->prop('DynamicContent') || 'disabled') =~ m/^enabled|on|yes|1$/);
my $key = $share->key;
$OUT .=_EOF;
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/tmp
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/wsdlcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache
_EOF
}
}
Loading…
Cancel
Save