more updates lol
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 22s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 22s
This commit is contained in:
@@ -17,6 +17,10 @@ When you run the script, you will be prompted to select which scripts you want t
|
|||||||
|
|
||||||
This script is used to backup a directory to a remote server using `rsync`. It is intended to be run as a cron job.
|
This script is used to backup a directory to a remote server using `rsync`. It is intended to be run as a cron job.
|
||||||
|
|
||||||
|
#### `nas-gdrive-backup.sh`
|
||||||
|
|
||||||
|
This script is used to both install itself and to run a periodic backup to Google Drive for files that had changed.
|
||||||
|
|
||||||
### `clean.sh`
|
### `clean.sh`
|
||||||
|
|
||||||
This script is used to clean some of the files, docker dangling images, and docker stopped/unused containers.
|
This script is used to clean some of the files, docker dangling images, and docker stopped/unused containers.
|
||||||
|
@@ -174,9 +174,12 @@ install_script() {
|
|||||||
|
|
||||||
install_log_separator
|
install_log_separator
|
||||||
# Check if running as root
|
# Check if running as root
|
||||||
|
install_log_info "Checking if the script is running as root"
|
||||||
if [ "$(id -u)" -ne 0 ]; then
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
install_log_error "ERROR: This script must be run as root"
|
install_log_error "ERROR: This script must be run as root"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
install_log_ok "Running as root"
|
||||||
fi
|
fi
|
||||||
install_log_separator
|
install_log_separator
|
||||||
|
|
||||||
@@ -205,7 +208,7 @@ install_script() {
|
|||||||
install_log_error "ERROR: ZIP_PASSWORD is not set"
|
install_log_error "ERROR: ZIP_PASSWORD is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
read -p "Enter ZIP_PASSWORD: " ZIP_PASSWORD
|
read -p "Enter ZIP_PASSWORD: " ZIP_PASSWORD </dev/tty
|
||||||
if [ -z "$ZIP_PASSWORD" ]; then
|
if [ -z "$ZIP_PASSWORD" ]; then
|
||||||
install_log_error "ERROR: ZIP_PASSWORD cannot be empty"
|
install_log_error "ERROR: ZIP_PASSWORD cannot be empty"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -233,6 +236,24 @@ install_script() {
|
|||||||
fi
|
fi
|
||||||
install_log_info "Setting permissions for $META_DIR and $TMP_DIR to 777"
|
install_log_info "Setting permissions for $META_DIR and $TMP_DIR to 777"
|
||||||
chmod -R 777 "$META_DIR" "$TMP_DIR"
|
chmod -R 777 "$META_DIR" "$TMP_DIR"
|
||||||
|
install_log_ok "Directories checked and are ok"
|
||||||
|
|
||||||
|
# Check for existing .sha256 files, if there are any, prompt to remove them
|
||||||
|
install_log_info "Verifying existing .sha256 files in $META_DIR"
|
||||||
|
for file in "$META_DIR"/*; do
|
||||||
|
if [ -f "$file" -a -name "*.sha256" ]; then
|
||||||
|
install_log_info "Found .sha256 file: \e[96m\e[4m$file\e[0m"
|
||||||
|
read -p "Do you want to remove this file? [y/N]: " choice </dev/tty
|
||||||
|
if [[ "$choice" == "y" || "$choice" == "Y" ]]; then
|
||||||
|
install_log_info "Removing $file"
|
||||||
|
rm "$file"
|
||||||
|
else
|
||||||
|
install_log_info "Skipping $file"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
install_log_ok "Existing .sha256 files checked"
|
||||||
|
|
||||||
install_log_separator
|
install_log_separator
|
||||||
|
|
||||||
install_log_info "Setting up rclone configuration"
|
install_log_info "Setting up rclone configuration"
|
||||||
|
Reference in New Issue
Block a user