mirror of
https://github.com/YunoHost-Apps/archivist_ynh.git
synced 2024-09-03 18:15:55 +02:00
29 lines
970 B
Bash
Executable file
29 lines
970 B
Bash
Executable file
#!/bin/bash
|
||
|
||
#=================================================
|
||
# IMPORT GENERIC HELPERS
|
||
#=================================================
|
||
|
||
source scripts/_common.sh
|
||
source /usr/share/yunohost/helpers
|
||
|
||
#=================================================
|
||
# CLEAN ALL BACKUP FILES
|
||
#=================================================
|
||
ynh_script_progression --message="Cleaning all backup files..." --weight=9
|
||
|
||
# Get the backup directory from the config file
|
||
backup_dir="$(grep "^backup_dir=" "$final_path/Backup_list.conf" | cut -d= -f2)"
|
||
|
||
while read -r directory <&3; do
|
||
if [ -n "$directory" ]; then
|
||
ynh_print_info --message="Clean backup directory $directory"
|
||
ynh_secure_remove --file="$directory"
|
||
fi
|
||
done 3<<< $(find "$backup_dir" -maxdepth 1 -mindepth 1 -type d)
|
||
|
||
#=================================================
|
||
# END OF SCRIPT
|
||
#=================================================
|
||
|
||
ynh_script_progression --message="Execution completed" --last
|