@@ -91,10 +91,7 @@ def __init__(self):
9191 self .home_dir = os .path .expanduser ('~' )
9292
9393 # Froster's home directory
94- self .froster_dir = os .path .join (sys .prefix )
95-
96- # Froster's binary directory
97- self .bin_dir = os .path .join (self .froster_dir , 'bin' )
94+ self .froster_dir = os .path .dirname (os .path .realpath (shutil .which ('froster' )))
9895
9996 # Froster's data directory
10097 xdg_data_home = os .environ .get ('XDG_DATA_HOME' )
@@ -3080,13 +3077,14 @@ def _index_locally(self, folder):
30803077 f' ...folder already indexed at { folder_hotspot } . Use "-f" or "--force" flag to force indexing.\n ' )
30813078 return
30823079
3080+
30833081 # Run pwalk on given folder
30843082 with tempfile .NamedTemporaryFile () as pwalk_output :
30853083 with tempfile .NamedTemporaryFile () as pwalk_output_folders :
30863084 with tempfile .NamedTemporaryFile () as pwalk_output_folders_converted :
30873085
30883086 # Build the pwalk command
3089- pwalk_bin = os .path .join (sys . prefix , 'bin' , 'pwalk' )
3087+ pwalk_bin = os .path .join (self . cfg . froster_dir , 'pwalk' )
30903088 pwalkcmd = f'{ pwalk_bin } --NoSnap --one-file-system --header'
30913089 mycmd = f'{ pwalkcmd } "{ folder } " > { pwalk_output .name } '
30923090
@@ -4285,6 +4283,8 @@ def _delete_locally(self, folder_to_delete):
42854283 f"Archive aws profile: { archived_folder_info ['profile' ]} \n " )
42864284 rme .write (f"Archiver user: { archived_folder_info ['user' ]} \n " )
42874285 rme .write (f'Archiver email: { self .cfg .email } \n ' )
4286+ rme .write (
4287+ f'froster-archives.json: { self .archive_json } \n ' )
42884288 rme .write (
42894289 f'Archive tool: https://github.com/dirkpetersen/froster\n ' )
42904290 rme .write (
@@ -5187,7 +5187,7 @@ def __init__(self, args: argparse.Namespace, cfg: ConfigManager):
51875187 self .cfg = cfg
51885188
51895189 # Set the Rclone executable path
5190- self .rc = os .path .join (sys . prefix , 'bin' , 'rclone' )
5190+ self .rc = os .path .join (self . cfg . froster_dir , 'rclone' )
51915191
51925192 # Set the Rclone environment variables
51935193 # Note: Keys are set in the AWS Boto __init__ function
@@ -6052,13 +6052,15 @@ def print_version(self):
60526052 def print_info (self ):
60536053 '''Print froster info'''
60546054
6055+ froster_dir = os .path .dirname (os .path .realpath (shutil .which ('froster' )))
6056+
60556057 log (
60566058 f'froster v{ pkg_resources .get_distribution ("froster" ).version } \n ' )
60576059 log (f'Tools version:' )
60586060 log (f' python v{ platform .python_version ()} ' )
6059- log (' pwalk ' , 'v' + subprocess .run ([os .path .join (sys . prefix , 'bin' , 'pwalk' ), '--version' ],
6061+ log (' pwalk ' , 'v' + subprocess .run ([os .path .join (froster_dir , 'pwalk' ), '--version' ],
60606062 stdout = subprocess .PIPE , stderr = subprocess .PIPE , text = True ).stderr .split ('\n ' )[0 ].split ()[2 ])
6061- log (' ' , subprocess .run ([os .path .join (sys . prefix , 'bin' , 'rclone' ), '--version' ],
6063+ log (' ' , subprocess .run ([os .path .join (froster_dir , 'rclone' ), '--version' ],
60626064 stdout = subprocess .PIPE , stderr = subprocess .PIPE , text = True ).stdout .split ('\n ' )[0 ])
60636065
60646066 log (textwrap .dedent (f'''
@@ -6109,11 +6111,6 @@ def subcmd_config(self, cfg: ConfigManager, aws: AWSBoto):
61096111 if self .args .print :
61106112 return cfg .print_config ()
61116113
6112- # if self.args.monitor:
6113- # froster_binary = os.path.join(cfg.bin_dir, 'froster')
6114- # return cfg.add_systemd_cron_job(
6115- # f'{froster_binary} restore --monitor', '30')
6116-
61176114 log (f'\n *****************************' )
61186115 log (f'*** FROSTER CONFIGURATION ***' )
61196116 log (f'*****************************\n ' )
@@ -7065,7 +7062,7 @@ def main():
70657062 cmd .print_help ()
70667063
70677064 # Check if there are updates on froster every X days
7068- if cfg .check_update () and args .subcmd not in ['update' , 'upd' ]:
7065+ if cfg .configuration_done and cfg . check_update () and args .subcmd not in ['update' , 'upd' ]:
70697066 cmd .subcmd_update (mute_no_update = True )
70707067
70717068 # Close the AWS session
0 commit comments