Archive for the tag 'exclude'

SBDavid

cpanelsync’s Exclude Functionality

cpanelsync’s Exclude Functionality

Setting cPanel-distributed files to immutable will cause a variety of problems. If you wish to prevent cPanel from updating certain files, do not make the files immutable. Instead, enter those files’ paths in /etc/cpanelsync.exclude.

Each entry in the /etc/cpanelsync.exclude file must use a fully specified path, with each path on its own line.

For example, if you wish to prevent the following files from updating:

/usr/local/cpanel/scripts/pkgacct
/usr/local/cpanel/Cpanel/Logd.pm

Add the files’ paths to /etc/cpanelsync.exclude using the following 2 commands:

echo “/usr/local/cpanel/scripts/pkgacct” >> /etc/cpanelsync.exclude
echo “/usr/local/cpanel/Cpanel/Logd.pm” >> /etc/cpanelsync.exclude

Note: This method only prevents the cpanelsync utility from updating files. It does not prevent updates that occur at application runtime. You cannot use cpanelsync.exclude to prevent modifications to configuration files, datastores, or similar types of files.

Reference: http://cpanel.net

SBDavid

rsync - exclude files and folders

rsync - exclude files and folders

First - define the files and folders you want to exclude from the rsync:

To do this create a file called ‘exclude.txt’ on the destination machine (the system you give the rsync command on):

pico /home/buddy/exclude.txt

Now we have defined what to exclude we can direct rsync to the file with:

–exclude-from ‘/home/buddy/exclude.txt’

The final command would be:

rsync -e ’ssh -p 2222′ -avl –delete –stats –progress –exclude-from ‘/home/buddy/exclude.txt’ root@192.168.1.1:/home/buddy /backup/