Skip to main content

createBackupSchedule

BooleanWrapper createBackupSchedule(CreateBackupScheduleRequestDto)

POST /api/2.0/backup/createbackupschedule

Create the backup schedule

Sets the backup schedule of the current portal. A portal keeps at most one schedule, so this replaces the existing one rather than adding a second, and dump writes the schedule of the whole server instead, which requires the space access permission and works on a standalone installation only. Scheduled backups have to be allowed by the pricing plan of a portal that is not a standalone installation. cronParams is a period plus a time rather than a cron string: hour is the hour of the day from 0 to 23, and day has to be given for EveryWeek, where it is the day of the week from 1 to 7 with Sunday as 1, and for EveryMonth, where it is the day of the month from 1 to 31. It is left out for EveryDay, and because an omitted day is stored as 0, which neither period accepts, a weekly or monthly schedule sent without it fails instead of falling back to a default. backupsStored is the number of scheduled copies to keep, from 1 to 30, and it defaults to 1. Older copies are removed by a background cleaner, and only the ones this schedule created: archives made by POST api/2.0/backup/startbackup are not counted and not removed. A portal whose subscription stops covering backups has its schedule deleted by the scheduler, not suspended, and its administrators are notified that the scheduled backup failed. The keys expected in storageParams are the same as for POST api/2.0/backup/startbackup, except that they are sent as an array of key and value pairs here and returned as an object by GET api/2.0/backup/getbackupschedule.

Parameters​

NameInTypeDescriptionNotes
CreateBackupScheduleRequestDtobodyCreateBackupScheduleRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200True if the schedule was savedBooleanWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, the number of the stored copies is outside 1-30, a dump was requested on a portal that is not a standalone installation, or storageParams repeats a key or, on a dump, contains tenantId--
402The portal subscription does not cover scheduled backups, has expired or has not been paid--
403No permissions to perform this action--
404The target folder was not found--
500cronParams is missing, its period is not a defined value, its hour or day is out of range for the period, which includes a weekly or monthly schedule sent without day, a key or value of storageParams is null, the folderId or filePath key the storage type needs is missing, or Local storage was requested on a portal that is not a standalone installation--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

BooleanWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json