Add fix duplicates task
This commit is contained in:
parent
21c9e41feb
commit
3d14eaaa8b
1 changed files with 31 additions and 0 deletions
|
@ -472,6 +472,37 @@ class mastodon (
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# Maintenance tasks
|
# Maintenance tasks
|
||||||
|
$_timer_duplicates = @("EOT")
|
||||||
|
[Unit]
|
||||||
|
Description=Mastodon - Fix duplicates
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=24min
|
||||||
|
OnUnitActiveSec=1d
|
||||||
|
Unit=mastodon_fix_duplicates.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
| EOT
|
||||||
|
|
||||||
|
$_service_duplicates = @("EOT")
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment='RAILS_ENV=production' 'PATH=${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
||||||
|
ExecStart=/opt/mastodon/live/bin/tootctl maintenance fix-duplicates
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
OnFailure=status_email_antoniodelgado@%n.service
|
||||||
|
| EOT
|
||||||
|
|
||||||
|
systemd::timer { 'mastodon_fix_duplicates.timer':
|
||||||
|
ensure => present,
|
||||||
|
timer_content => $_timer_duplicates,
|
||||||
|
service_unit => 'mastodon_fix_duplicates.service',
|
||||||
|
service_content => $_service_duplicates,
|
||||||
|
active => true,
|
||||||
|
enable => true,
|
||||||
|
}
|
||||||
# tootctl maintenance fix-duplicates
|
# tootctl maintenance fix-duplicates
|
||||||
# tootctl media remove --days 180
|
# tootctl media remove --days 180
|
||||||
# tootctl media remove-orphans
|
# tootctl media remove-orphans
|
||||||
|
|
Loading…
Reference in a new issue