Administration Tips

Restarting All Courier Services in one shot

root@mail:~# find /etc/init.d/|grep courier|while read line; do $line restart; done

Generate a random MAC Address

openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'

How to flush tinydns/dnscache

Some people say using

svc -du dnscache

will flush the dns cache. However, I have never had any such luck and must use the following

svc -t dnscache

Rsync complete filesystem

Sometimes I find myself in need of migrating a complete system into a VM or Container. Here is a pretty easy way to minimize downtime later.

rsync -aAHXv /* root@host.domain.tld:/var/lib/vz/private/115 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

As you can see above I am syncing to an OpenVZ container.

Move a running process to the background

This method cleanly moves a running process to the background and ensures you don't lose it when you log out of the session.

disown -h


/var/customers/webs/cw01/wiki/data/pages/admin_tips/services.txt · Last modified: 2016/09/29 10:11 by wadmin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki