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.
>>> myprofile = admin.backupProfiles[5]Displaying the current backup frequency
>>> 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
>>> sched.set_selection({'monday':True,'tuesday':True,'wednesday':False,...})
'Set Schedule' was successful
>>>
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
>>>
>>> sched.sunday=True
'Set Schedule' was successful
>>>
Displaying the current start or end time
>>> myprofile.starttime
datetime.datetime(2014, 4, 3, 10, 30, 8, 53700)
>>> myprofile.endtime
datetime.datetime(2015, 3, 10, 0, 0,)
>>>>>> 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
starttime property for the profile, similar
to the following example:- To set a start date and time, first define a
datetimeobject, 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() - Set the
starttimeproperty to the defined datetime object:>>> myprofile.starttime = st
Defining the backup end date and time
endtime property for
the profile, similar to the following example:- To set an end date and time, first define a
datetimeobject, 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) - Set the
endtimeproperty to the defined datetime object:>>> myprofile.endtime = et