2018-07-21 19:42:17 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
source scripts/_common.sh
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
|
# CLEAN ALL BACKUP FILES
|
|
|
|
|
#=================================================
|
2019-05-26 17:00:09 +02:00
|
|
|
|
ynh_script_progression --message="Cleaning all backup files..." --weight=9
|
2018-07-21 19:42:17 +02:00
|
|
|
|
|
|
|
|
|
# Get the backup directory from the config file
|
|
|
|
|
backup_dir="$(grep "^backup_dir=" "$final_path/Backup_list.conf" | cut -d= -f2)"
|
|
|
|
|
|
2024-03-29 13:08:31 +01:00
|
|
|
|
while read -r directory <&3; do
|
|
|
|
|
if [ -n "$directory" ]; then
|
2020-05-02 00:51:00 +02:00
|
|
|
|
ynh_print_info --message="Clean backup directory $directory"
|
|
|
|
|
ynh_secure_remove --file="$directory"
|
|
|
|
|
fi
|
2018-07-21 19:42:17 +02:00
|
|
|
|
done 3<<< $(find "$backup_dir" -maxdepth 1 -mindepth 1 -type d)
|
2019-01-30 16:07:38 +01:00
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
|
# END OF SCRIPT
|
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
ynh_script_progression --message="Execution completed" --last
|