admin's blog

Linux Quick backup of current folder

Sometimes you just need a fast backup of the current folder...

To adapt to Godaddy shared hosting SSH access, remove the sudo from the tar command.

# Simple bash script to compress the current folder structure into a
# tar.gz file in a backup folder under the current user home folder.

# Tested on various linux systems.

# Sets the date variable format for zipped file: MM-dd-yy_hh_mm
NOWDATE=`date +%Y-%m-%d_%H%M`


Sometimes you just need to wait...

@echo off
rem #
rem # Written by Ian Willis 2010-10-10
REM Launch an application ONLY if we can ping an address.
REM Loop until we do ping.

set shortcut=c:\Notepad.lnk

ping %server%
if %errorlevel%==1 (
Echo "Ping failed."

if %errorlevel%==0 (
msg %USERNAME% "Ping succeded, Application %shortcut% will start now."
start %shortcut%
goto exit


Find folder sizes on Ubuntu


I needed to find out the amount of data stored in a group of folders. Each of the folders contains a web site, and I want to track the sites on-disk usage statistics.


Linux system running bash.

du binary (typically induced in linux base install or busybox.

Tested on Ubuntu 12.


du -shc *

s ..... Summary
h ..... Human Readable. K, M, and G for sizes.
c ..... Summary or Total
* ..... All files or folders in the current directory.

Add SWAP disk on Amazon EC2 Ubuntu servers


My Ubuntu web servers were killing processes due to low free memory. I would prefer them to slow down than to kill processes. So I added SWAP disk space that is not setup by default in the EC2 instances.


Amazon AWS EC2 Ubuntu 11 or 12 instance.

This may work on other Linux versions, but I have only used it on Ubuntu.