How to exclude files from backup?
I'd like to back up my home directory but exclude a couple of massive video files which I don't need to back up. Otherwise my back up file will be unnecessarily big and take much time to download. Is this possible?
If you'd like to backup your account, but exclude certain files or directories, this can be done with a <strong>cpbackup-exclude.conf</strong> file placed inside your home directory such as <strong>/home/userna5</strong>.
It's important to note, that this will only exclude files when you are doing a <strong>Full Backup</strong>. Either from the <strong>Backups</strong> tool under <strong>Files</strong>, and clicking on <strong>Download or Generate a Full Website Backup</strong>. Or when using the <strong>Backup Wizard</strong>, and clicking on <strong>Full Backup --></strong>, and then <strong>Generate Backup</strong>.
If you you just click on <strong>Home Directory</strong> to download your <strong>/home/userna5/public_html/</strong> files, the exclude file will be ignored and your large movie files will still download.
Also keep in mind that as this would be a <strong>Full Backup</strong>, you probably want to exclude some other directories such as your mail if you're storing a lot on the server. That way you don't have excessive redundant backups on your account, or have to spend longer times downloading files to your computer.
So in your case, I'd probably recommend a <strong>cpbackup-exclude.conf</strong> file something along the lines of this:
<pre class="code_block" style="width: 500px; white-space: normal; margin-bottom: -30px;">access-logs/*
<strong style="color: red;">/public_html/videos/large_vid001.avi</strong>
<strong style="color: red;">/public_html/videos/large_vid002.avi</strong></pre>
The files I highlighted in <strong style="color: red;">red</strong> would be how you'd want to exclude them one by one. Or as you can see above those, if you want to exclude all the files from a directory, use an asterisk <strong>*</strong> after the directory.
If you have a very large account though, you'd more than likely instead want to select certain files specifically to archive with a cronjob. Then connect via FTP to your account to retrieve that backup for safe keeping.
I'll try to update this question with some guides, as it seem we don't have any written in our support center regarding this. Thanks again for the question and let us know if you had any others!
Like this Question? Tweet