CyberPanel Community

Exclude file from backup

ma
m_abotalebie #1

I need a feature for exclude some folder from backup

5 replies
NK
Nitesh Kunnath #2

Is that folder related to website or is it a private folder?

ma
m_abotalebie #3

folder is related to website but has large size of static data and does not need to backup every day.
like download or multimedia folders.

lu
luckyrajpurohit #4

Can Anyone let me know where I can define an excluded list of files and folders so that they are not included in the backup?.

MK
Mirza Khadnezar S [sick] #5

you cant
except you use premium support to do that
just like request wordpress tools…

lu
luckyrajpurohit #6

Here is solution

Define our excludes file for use with restic

backupExcludesFile = ‘/home/%s/backup-exclude.conf’ % (self.website.domain)
resticBackupExcludeCMD = ’ --exclude-file=%s’ % (backupExcludesFile)
command = ‘restic -r %s backup %s --password-file %s --exclude %s --exclude /home/%s/backup’ % (
self.repoPath, backupPath, self.passwordFile, self.repoPath, self.website.domain)

If /home/%s/backup-exclude.conf file exists lets pass this to restic by appending the command to end.

if os.path.isfile(backupExcludesFile):
command = command + resticBackupExcludeCMD

Sign in to reply