Friday, 30 December 2011

Scanner


Just fire the given command * :--


#!/bin/sh

echo " Searching for Banking folders"

find . -name "*bankofamerica*" -print

echo " Searching for banking strings in files"

find . -exec grep -q "onlinebanking" '{}' \; -print

******************---------------------*********************

Thursday, 29 December 2011

< rsync >process to restore accounts from old drive


Direct Admin rsync process to restore accounts from old drive :::----

-------**********-------------********-----------*******--------------

#Transfer /home data

rsync -av --progress /backup/root/home /


#Transfer important files from /etc drive.

rsync -av --progress /backup/root/etc/passwd /etc
rsync -av --progress /backup/root/etc/shadow /etc
rsync -av --progress /backup/root/etc/group /etc
rsync -av --progress /backup/root/etc/exim.conf /etc
rsync -av --progress /backup/root/etc/exim.pl /etc
rsync -av --progress /backup/root/etc/system_filter.exim /etc
rsync -av --progress /backup/root/etc/exim.crt /etc 
rsync -av --progress /backup/root/etc/exim.key /etc
rsync -av --progress /backup/root/etc/proftpd.conf /etc
rsync -av --progress /backup/root/etc/proftpd.vhosts.conf /etc
rsync -av --progress /backup/root/etc/proftpd.passwd /etc
rsync -av --progress /backup/root/etc/hosts /etc
rsync -av --progress /backup/root/etc/resolve.conf /etc
rsync -av --progress /backup/root/etc/named.conf /etc


rsync -av --progress /backup/root/etc/virtual/domainowners /etc/virtual
rsync -av --progress /backup/root/etc/virtual/domains /etc/virtual
rsync -av --progress /backup/root/etc/virtual/pophosts /etc/virtual


rsync -av --progress /backup/etc/virtual/majordomo/* /etc/virtual/majordomo



# Transfer HTTPD and configuration files

rsync -av --progress /backup/etc/httpd/conf/httpd.conf /etc/httpd/conf
rsync -av --progress /backup/etc/httpd/conf/ips.conf /etc/httpd/conf
rsync -av --progress /backup/root/etc/httpd/conf/ssl.crt /etc/httpd/conf

rsync -av --progress /backup/etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key


# Transfer logs and databases

rsync -av --progress /backup/var/named/* /var/named/
rsync -av --progress /backup/var/spool/virtual/* /var/spool/virtual
rsync -av --progress /backup/var/spool/mail/* /var/spool/mail
rsync -av --progress /backup/var/spool/cron/* /var/spool/cron
rsync -av --progress /backup/var/www/* /var/www
rsync -av --progress /backup/var/log/* /var/log
rsync -av --progress /backup/var/lib/mysql/* /var/lib/mysql


# Transfer frontpage config files

rsync -av --progress /backup/usr/local/frontpage/*.cnf /usr/local/frontpage

# Transfer directadmin configuration and user files

rsync -av --progress /backup/usr/local/directadmin/* /usr/local/directadmin


Cpanel :---

rsync -vrplogDtH /mnt/old/usr/local/apache/conf /usr/local/apache
rsync -vrplogDtH /mnt/old/var/named /var
rsync -vrplogDtH /mnt/old/home/* /home
rsync -vrplogDtH /mnt/old/usr/local/cpanel /usr/local
rsync -vrplogDtH /mnt/old/var/lib/mysql /var/lib
rsync -vrplogDtH /mnt/old/var/cpanel /var
rsync -vrplogDtH /mnt/old/usr/share/ssl /usr/share
rsync -vrplogDtH /mnt/old/var/ssl /var
rsync -vrplogDtH /mnt/old/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /mnt/old/var/log/bandwidth /var/log
rsync -vrplogDtH /mnt/old/usr/local/frontpage /usr/local
rsync -vrplogDtH /mnt/old/var/spool/cron /var/spool

-------------------------------********************************-------------------------------------

Sunday, 18 December 2011

Retry time out Error


<<< Insruction and steps are as follows  >>> :--

********************--------*************************

[root@server ~]# cd /var/spool/exim/db
[root@server db]# ll
total 66664
-rw-r-----  1 mailnull mail    12288 Jun 26 02:47 callout
-rw-r-----  1 mailnull mail    12288 Jun 26 02:47 misc
-rw-r-----  1 mailnull mail 79605760 Aug  5 11:46 ratelimit
-rw-r-----  1 mailnull mail        0 Jun 26 02:47 ratelimit.lockfile
-rw-r-----  1 mailnull mail   167936 Aug  5 11:45 retry
-rw-r-----  1 mailnull mail        0 Jun 26 02:49 retry.lockfile
-rw-r-----  1 mailnull mail    45056 Aug  5 11:45 wait-remote_smtp
-rw-r-----  1 mailnull mail        0 Jun 26 02:58 wait-remote_smtp.lockfile
[root@server db]# rm retry
rm: remove regular file `retry'? y
[root@server db]# rm retry.lockfile
rm: remove regular empty file `retry.lockfile'? y
[root@server db]# rm  wait-remote_smtp
rm: remove regular file `wait-remote_smtp'? y
[root@server db]# rm wait-remote_smtp.lock
rm: cannot lstat `wait-remote_smtp.lock': No such file or directory
[root@server db]# rm wait-remote_smtp.lockfile
rm: remove regular empty file `wait-remote_smtp.lockfile'? y
[root@server db]# service exim restart
Shutting down exim: [  OK  ]
Shutting down spamd: [  OK  ]
Starting exim-26: [  OK  ]
Starting exim: [  OK  ]
Starting exim-smtps: [  OK  ]
[root@server db]# sendmail -v "ncarey@sympatico.ca"

--------------------------------------------------------

Wednesday, 14 December 2011

Restore c-panel data from secondary drive using ( rsync )

*-* Just follow the given instruction *-* :--

*********************

# /etc User / IP's + passwd files

rsync -av --progress /oldhd/etc/passwd /etc/

rsync -av --progress /oldhd/etc/shadow /etc/

rsync -av --progress /oldhd/etc/group /etc/

rsync -av --progress /oldhd/etc/wwwacct.conf /etc/

rsync -av --progress /oldhd/etc/quota.conf /etc/

rsync -av --progress /oldhd/etc/domainalias /etc/

rsync -av --progress /oldhd/etc/remotedomains /etc/

rsync -av --progress /oldhd/etc/reservedipreasons /etc/

rsync -av --progress /oldhd/etc/reservedips /etc/

rsync -av --progress /oldhd/etc/secondarymx /etc/
rsync -av --progress /oldhd/etc/localdomains /etc/
rsync -av --progress /oldhd/etc/userdomains /etc/
rsync -av --progress /oldhd/etc/valiases /etc/
rsync -av --progress /oldhd/etc/vfilters /etc/
rsync -av --progress /oldhd/etc/vmail /etc/
rsync -av --progress /oldhd/etc/trueuserdomains /etc/
rsync -av --progress /oldhd/etc/ips /etc/
rsync -av --progress /oldhd/etc/domainips /etc/
rsync -av --progress /oldhd/etc/services /etc/



ftpd files

rsync -av --progress /oldhd/etc/sysconfig/pure-ftpd /etc/sysconfig/
rsync -av --progress /oldhd/etc/pure-ftpd.conf /etc/
rsync -av --progress /oldhd/etc/pure-ftpd /etc/
rsync -av --progress /oldhd/etc/proftpd /etc/
rsync -av --progress /oldhd/etc/proftpd.* /etc/

# /var

rsync -av --progress /oldhd/var/cpanel /var/
rsync -av --progress /oldhd/var/spool/cron /var/spool/
rsync -av --progress /oldhd/var/netenberg /var/



# /usr config - 3rdparty

rsync -av --progress /oldhd/usr/share/ssl /usr/share/
rsync -av --progress /oldhd/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty/
rsync -av --progress /oldhd/usr/local/cpanel/base/frontend /usr/local/cpanel/base/



# Apache

rsync -av --progress /oldhd/usr/local/apache/conf /usr/local/apache/
rsync -av --progress /oldhd/usr/local/frontpage /usr/local/



# Mysql config

rsync -av --progress /oldhd/root/.my.cnf /root/
rsync -av --progress /oldhd/etc/my.cnf /etc/



# Named

rsync -av --progress /oldhd/var/named /var/
rsync -av --progress /oldhd/etc/named.conf /etc/
rsync -av --progress /oldhd/etc/rndc.conf /etc/



# Mysql

rsync -av --progress /oldhd/var/lib/mysql /var/lib/




-*-*-*-*-*-*-*-*-*-*-*


#for RSYNC of home create  a sh file add the following lines, execute the file as sh file.sh


for SITE in `ls /oldhd/var/cpanel/users`

do

rsync -av --progress /oldhd/home/* /home/

done



rsync -av --progress /oldhd/etc/trueuserowners /etc/

exec,passthru,system,proc_open,popen