Monthly Archives: October 2011

Bash backup script

Posted by & filed under Linux, Server.

Here’s a script for backing up directories and databases. All files are compresses, and files older than 30 days are removed. # # Backup script # # Make compressed backups of directories/files, and old backups # Format: YEAR MONTH DAY – HOUR MINUTE SECOND DATE=$(date +%Y%m%d-%H%M%S) # backup directories and files tar -czf “/backup/target_file-$DATE.tar.gz” /home/username/public_html/home/… Read more »

Removing orphaned virtfs mounts

Posted by & filed under Linux.

Shows who is logged in: # who Anybody running a virtfs, or any orphaned virtfs users? cat /proc/mounts | grep virtfs Unmount them! for i in `cat /proc/mounts |grep virtfs |grep user_name_here |awk ‘{print$2}’`; do umount $i; done