backupProfiles - Define the schedule for backup operations

Use this command to define the schedule for when backup operations are performed with the backup profile.

After creating a backup profile that is configured to run according to a defined schedule (that is, the runonschedule attribute is set to true), you need to further define how often the backup is performed (daily or weekly) and, if weekly, specify which days of the week to run the backup. You can also configure the start time when the backup is performed each day, and the end date and time after which the backup operation is no longer run per the schedule.

In the following example, the variable myprofile is set to an existing backup profile that is configured for scheduled backups:
>>> myprofile = admin.backupProfiles[5]

Displaying the current backup frequency

You can retrieve the schedule property to display the list of days of the week on which the backup is performed. The output might look similar to the following example:
>>> sched=myprofile.schedule
>>> sched
{
  "friday": "T",
  "monday": "T",
  "saturday": "T",
  "sunday": "T",
  "thursday": "T",
  "tuesday": "T",
  "wednesday": "T"
}
>>>

In this case, note that all the days of the week are shown with a value T (true), meaning that backups are performed on a Daily basis.

If at least one of these day values are false (F), then the schedule is considered to run on a Weekly basis on the specified true (T) days.

Defining the backup frequency

To configure the frequency at which backups are performed, you can set the value for each day similar to the following example:
>>> sched.set_selection({'monday':True,'tuesday':True,'wednesday':False,...})
'Set Schedule' was successful
>>>
You can also use sched.all to set all the days of the week:
>>> sched.all=True
'Set Schedule' was successful
'Set Schedule' was successful
'Set Schedule' was successful
'Set Schedule' was successful
'Set Schedule' was successful
'Set Schedule' was successful
'Set Schedule' was successful
>>>
You can also set an individual day:
>>> sched.sunday=True
'Set Schedule' was successful
>>>

Displaying the current start or end time

You can retrieve the starttime or endtime property to display the current setting for the starting or ending date and time when backups are performed according to the schedule. The output might look similar to the following example:
>>> myprofile.starttime
datetime.datetime(2014, 4, 3, 10, 30, 8, 53700)
>>> myprofile.endtime
datetime.datetime(2015, 3, 10, 0, 0,)
>>>
You can change these to a string to display a more readable date and time:
>>> str(myprofile.starttime)
'2014-04-03 10:30:08.53700'
>>> str(myprofile.endtime)
'2015-03-10 00:00:00'
>>>

Defining the backup start date and time

To configure the date and time that backup operations are to begin, you can set the starttime property for the profile, similar to the following example:
  1. To set a start date and time, first define a datetime object, using the format:
    datetime.datetime(year, month, day, hour, minute, second)
    For example, to create a date of April 3, 2014 10:30am:
    >>> st=datetime.datetime(2014, 4, 3, 10, 30, 00)
    To create a date and time using today's date and the current time:
    >>> st=datetime.now()
  2. Set the starttime property to the defined datetime object:
    >>> myprofile.starttime = st
    

Defining the backup end date and time

If you do not specify an end date and time for the backup profile, backups will continue to run per the schedule indefinitely. To configure the date and time that backup operations cease to be run according to the schedule, you can set the endtime property for the profile, similar to the following example:
  1. To set an end date and time, first define a datetime object, using the format:
    datetime.datetime(year, month, day, hour, minute, second)
    For example, to create a date of June 17, 2014 11:00am:
    >>> et=datetime.datetime(2014, 6, 17, 11, 00, 00)
    To create a date and time in the future relative to today's date and the current time:
    >>> et=datetime.now() + timedelta(days=100)
  2. Set the endtime property to the defined datetime object:
    >>> myprofile.endtime = et