Archive for the 'cPanel Support' Category

Checking cpanel crontab user files.

Via root SSH access, either of the following commands may be used to list the contents:

# crontab -l -u username
# cat /var/spool/cron/username

usage: crontab

usage: crontab [-u user] file

crontab [-u user] { -e | -l | -r }
-e (edit user’s crontab)
-l (list user’s crontab)
-r (delete user’s crontab)
-i (prompt before deleting user’s crontab)

SBDavid

Backing up your files with rsync

Backing up your files with rsync

rsync makes the task a lot easier as it only downloads files that have changed - saving time and bandwidth.

Setup ssh keys so that you don’t need to enter a password each time you attempt to rsync folders.

On the destination server, the command is as follows:

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

-e ’ssh -p 2222′: this ensures rsync uses the SSH protocol and sets the port.

-avl: This contains three options;

(a) is archive mode which basically keep the permission settings for the files.
(v) is verbose mode. You can leave it out or increase it by appending two v’s (-vv).
(l) preserves any links you may have created.

–delete: deletes files from the destination folder that are no longer required (i.e. they have been deleted from the folder being backed up).

–stats: Adds a little more output regarding the file transfer status.

–progress: shows the progress of each file transfer. Can be useful to know if you have large files being backup up.

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/

Exporting and Importing mysql databases

Exporting the Database.

In this example, we will export the ‘mydb’ database into a file called ‘mydb.sql’:

mysqldump -u root -p mydb > mydb.sql

Importing the data is just as easy but involves two steps.

The first step is to create a blank database ready to receive the data.

mysqladmin -u root -p create mydb1

Once done, all that is left is to actually import the data:

mysql -u root -p mydb1 < mydb.sql

Removing a mail server from the Spamhaus PBL

How to check if your IP is listed.

http://www.spamhaus.org/lookup.lasso

Spamhaus assists Internet service providers with preventing unsolicited email (spam) from passing through their mail servers. One of the tools Spamhaus employs is a “Policy Block List” (PBL) that lists addresses that get assigned to customers of dial-up, broadband, and hosting service providers. Those addresses are then blocked by default and have to be manually removed from the list when someone has a legitimate need to use one of those addresses to run a mail server (as many Slicehost customers do). It is therefore likely that a new slice, or one that hasn’t been used as a mail server before, will be on the Spamhaus PBL.

Being on the PBL doesn’t mean your address is blocked for spamming. The list is only there as a precaution against potential abuse. Spamhaus applies this policy to any IP addresses that could change hands from one customer to another. Their goal is to prevent computers that should not be sending email directly from being able to do so if they are compromised in some way.

« Prev - Next »