@@ -863,30 +863,17 @@ def createBackup(self):
863863 command = 'restic'
864864 if ProcessUtilities .outputExecutioner (command ).find ('restic is a backup program which' ) == - 1 :
865865 try :
866+
866867 CentOSPath = '/etc/redhat-release'
867868
868869 if os .path .exists (CentOSPath ):
869- import platform
870- distro = 'centos'
871- release = platform .uname ().release
872-
873- url = 'https://api.github.com/repos/restic/restic/releases/latest'
874- releases = json .loads (str (requests .get (url ).text ))
875- version = releases ['tag_name' ].strip ('v' )
876- download_url = f'https://github.com/restic/restic/releases/download/v{ version } /restic_{ version } _linux_amd64.bz2'
877- ResticArchivePath = f'/root/restic_{ version } _linux_amd64.bz2'
878- ResticBinPath = '/usr/local/bin/restic'
879-
880- if distro == 'centos' and 'el7' in release :
881- command = 'yum install restic -y'
882- ProcessUtilities .executioner (command )
883- elif distro == 'centos' and 'el8' in release :
884- command = 'wget -O %s %s' % (ResticArchivePath , download_url )
870+ command = 'yum install -y yum-plugin-copr'
885871 ProcessUtilities .executioner (command )
886- command = 'bzip2 -dc %s > %s' % ( ResticArchivePath , ResticBinPath )
872+ command = 'yum copr enable -y copart/restic'
887873 ProcessUtilities .executioner (command )
888- command = 'chmod +x %s' % ResticBinPath
874+ command = 'yum install -y restic'
889875 ProcessUtilities .executioner (command )
876+
890877 else :
891878 command = 'apt-get update -y'
892879 ProcessUtilities .executioner (command )
@@ -898,7 +885,7 @@ def createBackup(self):
898885 logging .statusWriter (self .statusPath ,
899886 'It seems restic is not installed, for incremental backups to work '
900887 'restic must be installed. You can manually install restic using this '
901- 'guide -> http ://go.cyberpanel.net/restic. [5009]' , 1 )
888+ 'guide -> https ://go.cyberpanel.net/restic. [5009]' , 1 )
902889 pass
903890
904891 return 0
0 commit comments