Examples for date 8 October 2010 at 5:15am
==========================================

These instructions apply to command-line execution and when baklabel is called from a shell script or batch file. See also synopsis.txt for command line options used in the examples below.

When baklabel is imported into another program, usual Python rules apply.

In the following examples, please note that on Friday 8 October 2010 at 5:15am, it is the second Friday of the month. The default time for switching the label from yesterday to today is 4am. By default, if baklabel is run earlier than 4am it will return 'thu'.

Note also that the 6am and 5am examples below need to be considered from the viewpoint that it is currently 5:15am.

In particular, this means the 5am trigger point shown in the example is in the past so baklabel produces a label for today (fri_2). In the case of the 6am switch, the current time (5:15am) is before 6am so baklabel assumes the backup is labelled for yesterday (thu).

Remember that all the examples here were run at 05:15 on Friday 8 Oct 2010.


C:\baklabel>python baklabel.py
fri_2

C:\baklabel>python baklabel.py -d 2010-10-8
fri_2

C:\baklabel>python baklabel.py -d 8/10/2010 (should be 10/8/2010 in USA etc)
fri_2

C:\baklabel>python baklabel.py -d 8-10-2010
fri_2

C:\baklabel>python baklabel.py -d 29/2/2010 (not a leap year)
day is out of range for month

C:\baklabel>python baklabel.py -d 29/2/2012 (leap year)
feb

C:\baklabel>python baklabel.py -d 28/2/2010
feb

C:\baklabel>python baklabel.py -d 5am
fri_2

C:\baklabel>python baklabel.py -d 6am
thu

C:\baklabel>python baklabel.py -d -1 (yesterday)
thu

C:\baklabel>python baklabel.py -d -7
fri_1

C:\baklabel>python baklabel.py -d -8 (8 days ago was end-of-month)
sep

C:\baklabel>python baklabel.py -d 1
sat

C:\baklabel>python baklabel.py -s server_fred
server_fred_fri_2

C:\baklabel>python baklabel.py -w 3 (set day 3 to be end-of-week)
fri

C:\baklabel>python baklabel.py -w 3 -d -1 (ditto but -1 means yesterday)
thu_1


