Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Backup Notification after finish

Featured Replies

Hi there

 

I'm looking for a notification code to add in my backup script which I found on this site. By the way it works like a charm. I really recommend it to anybody who looks for a backup solution like apples time machine.

 

Would like to have to messages:

 

1. after finished without problems

2. if there is a problem, with information about the problem

 

Sorry, I'm not a coder. Can anyone help me please?

 

Thanks in advance.

greg

#!/bin/bash
#
# Backup mimicking Time Machine from Mac OS X using rsync
# --- Variables --- #

OS=$(uname -s)
HOST=$(hostname)
DATE_FORMAT=$(date "+%Y-%m-%d-%H%M%S")
CURRENT_YEAR=$(date +%Y)
CURRENT_MONTH=$(date +%m)
RSYNC_OPTIONS="--archive --partial --progress --human-readable"

# Use absolute paths. Relative paths tend to break the hard linking advantage of rsync.
# Paths can include spaces as long as variable contents are double quoted
SOURCE="/mnt/user/googledrive_resilio_sync/Sounds"
DESTINATION="/mnt/disks/backup_SAM_2876_sounds/Sounds"

# --- Main Program --- #

# Create destination if it does not exist
if [[ ! -d "$DESTINATION" ]] ; then
  mkdir -p "$DESTINATION"
fi

# Make inital backup if Latest does not exist, otherwise only copy what has changed
# and hard link to files that are the same
if [[ ! -L "$DESTINATION"/Latest ]] ; then
  rsync $RSYNC_OPTIONS \
                --delete \
                "$SOURCE" "$DESTINATION"/$DATE_FORMAT
else
  rsync $RSYNC_OPTIONS \
               --delete \
               --delete-excluded \
               --link-dest="$DESTINATION"/Latest \
               "$SOURCE" "$DESTINATION"/$DATE_FORMAT
fi

# Remove symlink to previous Latest backup
rm -f "$DESTINATION"/Latest

# Create symlink to latest backup
ln -s $DATE_FORMAT "$DESTINATION"/Latest



# --- Remove old backups --- #

# BSD date in OS X has a different syntax than GNU date in Linux
if [[ $OS == "Darwin" || $OS == "FreeBSD" ]]; then

  # Return YYYY one year ago from today
  LAST_YEAR=$(date -v -1y "+%Y")

elif [[ $OS == "Linux" ]]; then

  # Return YYYY one year ago from today
  LAST_YEAR=$(date -d "last year" "+%Y")

fi


# Keep monthly backups for one year
for (( month = 1 ; month < $CURRENT_MONTH ; month++ )); do
  # List latest backup from each month of current year
  # Use printf to pad the single digit months with a 0
  LATEST_BACKUP=$(find "$DESTINATION" -mindepth 1 -maxdepth 1 -name ${CURRENT_YEAR}-$(printf "%02d" $month)-* | sort | tail -n 1)
  find "$DESTINATION" -mindepth 1 -maxdepth 1 -name ${CURRENT_YEAR}-$(printf "%02d" $month)-* | grep -v "$LATEST_BACKUP" | xargs -I {} rm -rf {}
done

for (( month = $CURRENT_MONTH ; month <= 12 ; month++ )); do
  # List latest backup from each month of current year
  # Use printf to pad the single digit months with a 0
  LATEST_BACKUP=$(find "$DESTINATION" -mindepth 1 -maxdepth 1 -name ${LAST_YEAR}-$(printf "%02d" $month)-* | sort | tail -n 1)
  find "$DESTINATION" -mindepth 1 -maxdepth 1 -name ${LAST_YEAR}-$(printf "%02d" $month)-* | grep -v "$LATEST_BACKUP" | xargs -I {} rm -rf {}
done


# Remove backups older than one year
for (( month = 1 ; month < $CURRENT_MONTH ; month++ )); do
  find "$DESTINATION" -mindepth 1 -maxdepth 1 -type d -name "$LAST_YEAR-$(printf "%02d" $month)-*" | xargs -I {} rm -rf {}
done

find "$DESTINATION" -mindepth 1 -maxdepth 1 -type d ! -name "$CURRENT_YEAR-*" | grep -v "$LAST_YEAR-*" | xargs -I {} rm -rf {}

 

 

/usr/local/emhttp/plugins/dynamix/scripts/notify

You'll see all the options available when you enter in the above

  • Author

thx... and which part exactly? All?

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.