如何设置Déjà Dup备份调度时间?修改定时任务方法咨询
Hey there! Let's tackle your Déjà Dup scheduling questions one by one:
Can you set Déjà Dup's automatic backup time?
Absolutely! The simplest way is right through the graphical interface—no need to dive into config files first. Here's how:
- Open Déjà Dup (search for "Backups" in your app menu)
- Switch to the Schedule tab (labeled "Automatic Backups" in some versions)
- You’ll find options to set backup frequency (daily, weekly, etc.) and a specific start time. Pick a window when you know your cloud drive will be accessible, and that’s it.
Where is Déjà Dup's cron/timer task located?
Déjà Dup uses different scheduling systems depending on your setup:
- Modern GNOME-based systems (Ubuntu, Fedora, etc.): It relies on systemd user timers instead of traditional cron. You’ll find the relevant files in your user config directory:
- Timer file:
~/.config/systemd/user/deja-dup-backup.timer - Matching service file:
~/.config/systemd/user/deja-dup-backup.service - To check the timer’s status, run:
systemctl --user list-timers deja-dup-backup.timer
- Timer file:
- Older/non-GNOME setups: It may use a user-specific crontab entry. Open your crontab with
crontab -eand look for lines starting withdeja-dup --backup.
Can you manually modify the schedule?
Yes, you’ve got a few options—pick the one that fits your comfort level:
Graphical Interface (Recommended)
Stick to the Schedule tab in Déjà Dup. Adjusting the time here is safest, as it ensures all related configs get updated correctly.
Modify the Systemd Timer
If you prefer the command line:
- Open the timer file in a text editor:
nano ~/.config/systemd/user/deja-dup-backup.timer - Locate the
OnCalendarline—it uses systemd’s calendar format (e.g.,OnCalendar=daily *-*-* 03:00:00for 3 AM daily) - Update the time to your preferred window, save the file, then reload systemd and restart the timer:
systemctl --user daemon-reload systemctl --user restart deja-dup-backup.timer
Modify the Crontab
If cron is being used:
- Open your user crontab:
crontab -e - Find the Déjà Dup backup line (it might look like
0 3 * * * deja-dup --backup) - Adjust the cron schedule fields (minute, hour, day, month, weekday) to your desired time. For example, to run at 8 PM every weekday, use
0 20 * * 1-5 deja-dup --backup - Save and exit—crontab will apply the changes automatically.
A quick bonus tip: To avoid failed backups when your cloud drive is inaccessible, you can add a pre-check to your backup command. For example, in the systemd service or crontab, replace deja-dup --backup with:
if mountpoint -q /path/to/your/cloud/drive; then deja-dup --backup; fi
This only runs the backup if the drive is mounted.
内容的提问来源于stack exchange,提问作者João Pimentel Ferreira

