- Plesk for Linux
- Plesk for Windows
Is it possible to create scheduled backup tasks via CLI/API?
Such functionality is yet to be implemented in Plesk.
If you would like to see these features in Plesk, please vote for them on Plesk UserVoice:
A cron task can be added to schedule backups to a remote storage for example:
# echo '/usr/local/psa/bin/pleskbackup server --output-file=ftp://username:firstname.lastname@example.org/myfolder' > /etc/cron.weekly/99plesk-backup && chmod +x /etc/cron.weekly/99plesk-backup
Note: for the following, the usage of Powershell is required.
Run the following commands to schedule a server-wide daily backup at 1am for example:
PS C:> $action = New-ScheduledTaskAction -Execute 'C:\Windows\system32\cmd.exe' -Argument '/c "plesk bin pleskbackup --server"'
PS C:> $trigger = New-ScheduledTaskTrigger -Daily -At 1am
PS C:> $principal = New-ScheduledTaskPrincipal -UserId SYSTEM
PS C:> Register-ScheduledTask -Action $action -Principal $principal -Trigger $trigger -TaskName "Daily Backup at 1am"