replaced 7z to zip

This commit is contained in:
localhost_frssoft 2022-08-07 23:14:19 +03:00
parent a5e6ceb077
commit a85d67dab5
2 changed files with 4 additions and 2 deletions

View file

@ -12,7 +12,7 @@ for i in $ids; do
if [ -f "$main_basedir"/all_statuses/$instance/$i/$i.json ]; then if [ -f "$main_basedir"/all_statuses/$instance/$i/$i.json ]; then
ids=$(echo "$ids" | sed -E "s/.?$i.?//g") ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
continue continue
elif [ -n "$(7z e -so $main_basedir/archives/$instance.7z $i | cat)" ]; then elif [ -n "$(unzip -p $main_basedir/archives/$instance.zip "**/$i.json")" ]; then
ids=$(echo "$ids" | sed -E "s/.?$i.?//g") ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
continue continue
elif [ -d "$main_basedir"/all_statuses/$instance/$i ]; then elif [ -d "$main_basedir"/all_statuses/$instance/$i ]; then

View file

@ -7,7 +7,9 @@ for i in "$main_basedir"/all_statuses/$instance/*; do
old_check=$(date +'%s' -r "$i"/*.json) old_check=$(date +'%s' -r "$i"/*.json)
if [ $old_check -lt $unixtime_offset ]; then if [ $old_check -lt $unixtime_offset ]; then
7z a -sdel "$main_basedir"/archives/$instance.7z $i zip -r -m -u -X "$main_basedir"/archives/$instance.zip $i
echo "[Archiver] Olded status $i $(date -d "@$old_check") moved to archive" echo "[Archiver] Olded status $i $(date -d "@$old_check") moved to archive"
fi fi
done done
find "$main_basedir"/all_statuses/$instance -type d -empty -exec rmdir {} + # Fix not removed empty folder after move (zip bug)