Package duplicity :: Module globals
[hide private]
[frames] | no frames]

Source Code for Module duplicity.globals

  1  # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- 
  2  # 
  3  # Copyright 2002 Ben Escoto <ben@emerose.org> 
  4  # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> 
  5  # 
  6  # This file is part of duplicity. 
  7  # 
  8  # Duplicity is free software; you can redistribute it and/or modify it 
  9  # under the terms of the GNU General Public License as published by the 
 10  # Free Software Foundation; either version 2 of the License, or (at your 
 11  # option) any later version. 
 12  # 
 13  # Duplicity is distributed in the hope that it will be useful, but 
 14  # WITHOUT ANY WARRANTY; without even the implied warranty of 
 15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 16  # General Public License for more details. 
 17  # 
 18  # You should have received a copy of the GNU General Public License 
 19  # along with duplicity; if not, write to the Free Software Foundation, 
 20  # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 21   
 22  """Store global configuration information""" 
 23   
 24  import socket, os 
 25   
 26  # The current version of duplicity 
 27  version = "$version" 
 28   
 29  # The name of the current host, or None if it cannot be set 
 30  hostname = socket.getfqdn() 
 31   
 32  # The main local path.  For backing up the is the path to be backed 
 33  # up.  For restoring, this is the destination of the restored files. 
 34  local_path = None 
 35   
 36  # The symbolic name of the backup being operated upon. 
 37  backup_name = None 
 38   
 39  # For testing -- set current time 
 40  current_time = None 
 41   
 42  # Set to the Path of the archive directory (the directory which 
 43  # contains the signatures and manifests of the relevent backup 
 44  # collection), and for checkpoint state between volumes. 
 45  # NOTE: this gets expanded in duplicity.commandline 
 46  os.environ["XDG_CACHE_HOME"] = os.getenv("XDG_CACHE_HOME", os.path.expanduser("~/.cache")) 
 47  archive_dir = os.path.expandvars("$XDG_CACHE_HOME/duplicity") 
 48   
 49  # config dir for future use 
 50  os.environ["XDG_CONFIG_HOME"] = os.getenv("XDG_CONFIG_HOME", os.path.expanduser("~/.config")) 
 51  config_dir = os.path.expandvars("$XDG_CONFIG_HOME/duplicity") 
 52   
 53  # Restores will try to bring back the state as of the following time. 
 54  # If it is None, default to current time. 
 55  restore_time = None 
 56   
 57  # If set, restore only the subdirectory or file specified, not the 
 58  # whole root. 
 59  restore_dir = None 
 60   
 61  # The backend representing the remote side 
 62  backend = None 
 63   
 64  # If set, the Select object which iterates paths in the local 
 65  # source directory. 
 66  select = None 
 67   
 68  # Set to GPGProfile that will be used to compress/uncompress encrypted 
 69  # files.  Replaces encryption_keys, sign_key, and passphrase settings. 
 70  gpg_profile = None 
 71   
 72  # Options to pass to gpg 
 73  gpg_options = '' 
 74   
 75  # If true, filelists and directory statistics will be split on 
 76  # nulls instead of newlines. 
 77  null_separator = None 
 78   
 79  # number of retries on network operations 
 80  num_retries = 5 
 81   
 82  # True if Pydev debugger should be activated 
 83  pydevd = False 
 84   
 85  # Character used like the ":" in time strings like 
 86  # 2002-08-06T04:22:00-07:00.  The colon isn't good for filenames on 
 87  # windows machines. 
 88  time_separator = ":" 
 89   
 90  # If this is true, only warn and don't raise fatal error when backup 
 91  # source directory doesn't match previous backup source directory. 
 92  allow_source_mismatch = None 
 93   
 94  # If set, abort if cannot do an incremental backup.  Otherwise if 
 95  # signatures not found, default to full. 
 96  incremental = None 
 97   
 98  # If set, print the statistics after every backup session 
 99  print_statistics = True 
100   
101  # If set, use short (< 30 char) filenames for all the remote files. 
102  short_filenames = False 
103   
104  # If set, forces a full backup if the last full backup is older than 
105  # the time specified 
106  full_force_time = None 
107   
108  # Used to confirm certain destructive operations like deleting old files. 
109  force = None 
110   
111  # If set, signifies time in seconds before which backup files should 
112  # be deleted. 
113  remove_time = None 
114   
115  # If set, signifies the number of backups chains to keep when performing 
116  # a remove-all-but-n-full. 
117  keep_chains = None 
118   
119  # If set, signifies that remove-all-but-n-full in progress 
120  remove_all_but_n_full_mode = None 
121   
122  # If set, signifies that remove-all-inc-of-but-n-full in progress (variant of remove-all-but-n-full) 
123  remove_all_inc_of_but_n_full_mode = None 
124   
125  # Don't actually do anything, but still report what would be done 
126  dry_run = False 
127   
128  # If set to false, then do not encrypt files on remote system 
129  encryption = True 
130   
131  # volume size. default 25M 
132  volsize = 25*1024*1024 
133   
134  # Working directory for the tempfile module. Defaults to /tmp on most systems. 
135  temproot = None 
136   
137  # network timeout value 
138  timeout = 30 
139   
140  # FTP data connection type 
141  ftp_connection = 'passive' 
142   
143  # Protocol for webdav 
144  webdav_proto = 'http' 
145   
146  # Asynchronous put/get concurrency limit 
147  # (default of 0 disables asynchronicity). 
148  async_concurrency = 0 
149   
150  # Whether to use "new-style" subdomain addressing for S3 buckets. Such 
151  # use is not backwards-compatible with upper-case buckets, or buckets 
152  # that are otherwise not expressable in a valid hostname. 
153  s3_use_new_style = False 
154   
155  # Whether to create European buckets (sorry, hard-coded to only 
156  # support european for now). 
157  s3_european_buckets = False 
158   
159  # File owner uid keeps number from tar file. Like same option in GNU tar. 
160  numeric_owner = False 
161   
162  # Whether to use plain HTTP (without SSL) to send data to S3 
163  # See <https://bugs.launchpad.net/duplicity/+bug/433970>. 
164  s3_unencrypted_connection = False 
165   
166  # Whether to use S3 Reduced Redudancy Storage 
167  s3_use_rrs = False 
168   
169  # True if we should use boto multiprocessing version 
170  s3_use_multiprocessing = False 
171   
172  # Chunk size used for S3 multipart uploads.The number of parallel uploads to 
173  # S3 be given by chunk size / volume size. Use this to maximize the use of 
174  # your bandwidth. Defaults to 25MB 
175  s3_multipart_chunk_size = 25*1024*1024 
176   
177  # Minimum chunk size accepted by S3 
178  s3_multipart_minimum_chunk_size = 5*1024*1024 
179   
180  # Whether to use the full email address as the user name when 
181  # logging into an imap server. If false just the user name 
182  # part of the email address is used. 
183  imap_full_address = False 
184   
185  # Name of the imap folder where we want to store backups. 
186  # Can be changed with a command line argument. 
187  imap_mailbox = "INBOX" 
188   
189  # Whether the old filename format is in effect. 
190  old_filenames = False 
191   
192  # Wheter to specify --use-agent in GnuPG options 
193  use_agent = False 
194   
195  # ssh commands to use 
196  scp_command = "scp" 
197  sftp_command = "sftp" 
198   
199  # default to batch mode using public-key encryption 
200  ssh_askpass = False 
201   
202  # user added ssh options 
203  ssh_options = "" 
204   
205  # whether to use scp for put/get, sftp is default 
206  use_scp = False 
207   
208  # user added rsync options 
209  rsync_options = "" 
210   
211  # will be a Restart object if restarting 
212  restart = None 
213   
214  # used in testing only - raises exception after volume 
215  fail_on_volume = 0 
216   
217  # used in testing only - skips uploading a particular volume 
218  skip_volume = 0 
219   
220  # ignore (some) errors during operations; supposed to make it more 
221  # likely that you are able to restore data under problematic 
222  # circumstances. the default should absolutely always be True unless 
223  # you know what you are doing. 
224  ignore_errors = False 
225   
226  # If we should be particularly aggressive when cleaning up 
227  extra_clean = False 
228   
229  # Renames (--rename) 
230  rename = {} 
231