You could use the similar part of the dietpi script in /etc/cron-daily in /etc/weekly.
Generate a file dietpi
in /etc/weekly
like this:
#!/bin/bash
{
#////////////////////////////////////
# DietPi Cron.Weekly script
#
#////////////////////////////////////
#
# Info:
# - Location: /etc/cron.weekly/dietpi
#
#////////////////////////////////////
# Assure that whiptail dialogues are skipped, even when the script is called manually, since STDOUT is redirected
export G_INTERACTIVE=0
#----------------------------------------------------------------
# DietPi-Backup weekly
/boot/dietpi/dietpi-backup 1
#----------------------------------------------------------------
}
I am not sure whether the line export G_INTERACTIVE
is needed.
@MichaIng: Can you clearify this?
The script above does not interpret the DAILY_BACKUP
option of dietpi-backup
.
Use dietpi-cron
to set the instant of time the backup shall take place.
If you would change the script dietpi-backup
, e.g. to add an option WEEKLY_BACKUP
, this would be overwritten in case of DietPi updates.
This would be an extension of dietpi-backup
to add such an option and suppress the daily backup at the day of the weekly backup. Additionally, a different location for the weekly backup with a different Amount
option would be needed.