function varsync_start () { # Assuming that we mounted /var as tmpfs in the previous step stat_busy "Rsyncing /var-sync/ to /var/" /usr/bin/rsync -ax /var-sync/ /var/ stat_done } function varsync_stop () { # saving the /var filesystem from the tmpfs echo -e 'y\ny' | /usr/bin/pacman -Scc >/dev/null stat_busy "Rsyncing /var/ to /var-sync/" /usr/bin/rsync -ax --delete /var/ /var-sync/ stat_done } add_hook sysinit_postmount varsync_start add_hook shutdown_preumount varsync_stop