mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-01 07:57:17 +00:00
14 lines
424 B
Bash
Executable file
14 lines
424 B
Bash
Executable file
#!/bin/sh
|
|
|
|
mkdir -p "$main_basedir/archives/"
|
|
unixtime_offset=$(expr $(date "+%s") - 86400)
|
|
|
|
for i in "$main_basedir"/all_statuses/$instance/*; do
|
|
|
|
old_check=$(date +'%s' -r "$i"/*.json)
|
|
if [ $old_check -lt $unixtime_offset ]; then
|
|
7z a -sdel "$main_basedir"/archives/$instance.7z $i
|
|
echo "[Archiver] Olded status $i $(date -d "@$old_check") moved to archive"
|
|
fi
|
|
done
|