Fix pleroma expire script
This commit is contained in:
parent
d6bc979aeb
commit
5c8b3c7ab9
|
@ -165,6 +165,7 @@ function expire_pleroma_posts {
|
|||
chmod +x $pleroma_expire_posts_script
|
||||
|
||||
pleroma_expire_script=/etc/cron.daily/pleroma-expire
|
||||
expire_days_files_threshold=$(($expire_days_files - 1))
|
||||
echo '#!/bin/bash' > $pleroma_expire_script
|
||||
echo 'cd /etc/postgresql' >> $pleroma_expire_script
|
||||
echo 'if [ -d /etc/pleroma/tempfiles ]; then' >> $pleroma_expire_script
|
||||
|
@ -187,11 +188,11 @@ function expire_pleroma_posts {
|
|||
echo ' nowdate=$(date +%s)' >> $pleroma_expire_script
|
||||
echo ' sinceepoch=$(date +%s -r $imagefile)' >> $pleroma_expire_script
|
||||
echo ' daysold=$((($nowdate - $sinceepoch) / 86400))' >> $pleroma_expire_script
|
||||
echo " if [ \$daysold -ge ${expire_days_files} ]; then" >> $pleroma_expire_script
|
||||
echo ' if [ ! -d /etc/pleroma/tempfiles/$imagedir ]; then' >> $pleroma_expire_script
|
||||
echo ' mkdir /etc/pleroma/tempfiles/$imagedir' >> $pleroma_expire_script
|
||||
echo " if [ \$daysold -ge ${expire_days_files_threshold} ]; then" >> $pleroma_expire_script
|
||||
echo ' if [ ! -d $imagedir ]; then' >> $pleroma_expire_script
|
||||
echo ' mkdir $imagedir' >> $pleroma_expire_script
|
||||
echo ' fi' >> $pleroma_expire_script
|
||||
echo ' cp -rp $imagefile /etc/pleroma/tempfiles/$imagedir' >> $pleroma_expire_script
|
||||
echo ' cp -rp $imagefile $imagedir' >> $pleroma_expire_script
|
||||
echo ' fi' >> $pleroma_expire_script
|
||||
echo ' fi' >> $pleroma_expire_script
|
||||
echo ' fi' >> $pleroma_expire_script
|
||||
|
|
Loading…
Reference in New Issue