updating script
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 22s

This commit is contained in:
2025-07-26 21:55:47 -03:00
parent 1d6dae86a7
commit 8c0235ebf2

View File

@@ -33,27 +33,6 @@ clean_up() {
trap clean_up EXIT trap clean_up EXIT
# Check if 7z is installed
if ! which 7z; then
log "ERROR: 7z is not installed"
exit 1
fi
# Check if rclone is installed
if ! which rclone; then
log "ERROR: rclone is not installed"
exit 1
fi
# Create meta directory if it doesn't exist
if [ ! -d "$META_DIR" ]; then
log "Creating meta directory: $META_DIR"
mkdir -p "$META_DIR"
fi
# Fix permissions for the meta directory (777 recursively)
chmod -R 777 "$META_DIR"
create_7z() { create_7z() {
local folder="$1" local folder="$1"
local archive_name="$2" local archive_name="$2"
@@ -81,6 +60,28 @@ upload_to_gdrive() {
fi fi
} }
main() {
# Check if 7z is installed
if ! which 7z > /dev/null; then
log "ERROR: 7z is not installed"
exit 1
fi
# Check if rclone is installed
if ! which rclone > /dev/null; then
log "ERROR: rclone is not installed"
exit 1
fi
# Create meta directory if it doesn't exist
if [ ! -d "$META_DIR" ]; then
log "Creating meta directory: $META_DIR"
mkdir -p "$META_DIR"
fi
# Fix permissions for the meta directory (777 recursively)
chmod -R 777 "$META_DIR"
# Loop through each folder in the backup source # Loop through each folder in the backup source
for folder in "$BACKUP_SOURCE"/*; do for folder in "$BACKUP_SOURCE"/*; do
if [ -d "$folder" ]; then if [ -d "$folder" ]; then
@@ -127,11 +128,18 @@ for folder in "$BACKUP_SOURCE"/*; do
log "" log ""
done done
# Fix permissions for the meta directory (777 recursively)
chmod -R 777 "$META_DIR"
log "Backup process completed successfully" log "Backup process completed successfully"
# Exit with success # Exit with success
exit 0 exit 0
}
###########################
### Installation script ###
###########################
# Function to install a dependency if not already installed # Function to install a dependency if not already installed
install_dependency() { install_dependency() {
local package="$1" local package="$1"
@@ -256,3 +264,6 @@ install_script() {
# Exit with success # Exit with success
exit 0 exit 0
} }
main "$@"
exit 0