a n,hV@svdZddlmZddlZddlZddlZejddddlm Z m Z e eefdddZ d d Z ed krre dS) z%Move cpanel backups to and from /home)PathNz/opt/support/lib)cpmove_file_type path_in_home)returncCsDtjtd}|jddtdd|jddtdd|}|j|jfS) z0Validate and return source and destination paths) descriptionsrcZSOURCEzcPanel backup file)metavartypehelpdstZ DESTINATIONzdestination folder) argparseArgumentParser__doc__ add_argumentrr parse_argsrr )parserargsr./opt/tier2c/mv_backup.pyr s rc Csxt\}}||j}z.ttt|dtt|||Wn.tyr}zt |WYd}~n d}~00dS)zN) rjoinpathnameprintshlexquotestrrenameOSErrorsysexit)sourceZdest_dirdestexcrrrmains   r"__main__)rpathlibrr rrpathinsertZ arg_typesrrtuplerr"__name__rrrrs