Order of profile execution

Asked by backa on 2009-08-17


I spend much time writing scripts for different profiles under sbackup and now I found this great program which can do much more. I used the configuration tool and created two profiles, but unfortunately not in the order I want them to be executed. One of them has a local and one has a remote target and I'd like the local to be the first one. Is there any way to set an order?

I figured the relevant part is the command cfiles = os.listdir( confdir ) in def __retrieve_confm(self): in nssbackupd.py. The documentation http://docs.python.org/library/os.html says: The list is in arbitrary order.
According to my tests with the configuration gui the order is the same as in "ls -U" (list entries in directory order, whatever this is). Renaming the second configuration file helped in a sense that the gui shows my desired order (and so the execution will probably in the same, though it does not use the same function, but the same listdir command).

My idea (as a non-python programmer) is to add right below the listdir command a cfiles.sort() commmand which should sort the list according to the built-in comparators of the unicode resp string classes. I can confirm this works for the gui when applied to the config manager. I hope (and will see tomorrow) if it works when I add a sort after all os.listdir's (I guess better too many than too view, there are just a couple of them). For the next version I suggest this as default, because then its very easy to set an order by adding prefixes to the config file names.

Question information

English Edit question
nssbackup Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:

This question was reopened

if you use Nssbackup in root mode you are able to have automated backup at given hours.....so you cans choose the time you want each profile

backa (fzskqgiptwpzk) said : #2

Oh, I totally forgot: I am using anacron daily because my pc is not running 24/7.

backa (fzskqgiptwpzk) said : #3

Sorting the lists solved my problem.