Select Page

Download an entire website with wget, along with assets

# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com

# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
--restrict-file-names=windows \ # Modify filenames to work in Windows as well.
--domains yoursite.com \ # Do not follow links outside this domain.
--no-parent \ # Don't follow links outside the directory you pass in.
yoursite.com/whatever/path # The URL to download

Source: https://gist.github.com/mikecrittenden/fe02c59fed1aeebd0a9697cf7e9f5c0c

How to move the home directory to a new disk in Linux

I needed to move the home directory into an attached block storage on an Ubuntu server and found this simple and clear Tecmint article:

How to Move Home Directory to New Partition or Disk in Linux

In particular, other than the obvious fstab, the bits I was looking for were:
# mkdir -p /srv/home
# mount /dev/sdb /srv/home
# rsync -av /home/* /srv/home/
# diff -r /home /srv/home
# rm -rf /home/*
# umount /srv/home
# mount /dev/sdb /home
# ls -l /home

Furthermore, I wanted to verify what happens if I need to resize the block storage volume, and that’s now possible to do online (without having to unmount) thanks to resize2fs and recent kernels which is pretty neat:
# resize2fs /dev/sdb