Skip to content

Commit

Permalink
improvements createbackup
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Jul 4, 2024
1 parent f3e0e35 commit 5b0b3ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/views/tenant/backup/CreateBackup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ const CreateBackup = () => {

const onSubmit = (values) => {
const startDate = new Date()
startDate.setHours(0, 0, 0, 0)
//decrease by 45 seconds to ensure the task runs after the current time
const unixTime = Math.floor(startDate.getTime() / 1000) - 45
const shippedValues = {
TenantFilter: tenantDomain,
Name: `CIPP Backup ${tenantDomain}`,
Command: { value: `New-CIPPBackup` },
Parameters: { ...values },
Parameters: { backupType: 'Scheduled', ScheduledBackupValues: { ...values } },
ScheduledTime: unixTime,
Recurrence: '1d',
Recurrence: { value: '1d' },
}
genericPostRequest({ path: '/api/AddScheduledItem?hidden=true', values: shippedValues }).then(
(res) => {
Expand Down

0 comments on commit 5b0b3ea

Please sign in to comment.