Skip to content

Instantly share code, notes, and snippets.

@Termiux
Created October 20, 2011 16:27
Show Gist options
  • Save Termiux/1301595 to your computer and use it in GitHub Desktop.
Save Termiux/1301595 to your computer and use it in GitHub Desktop.
Little script that I wrote as a workaround for PXE booting a FOG server
#!/bin/bash
# ==================== IMPORTANT ======================
# This script is esential for fog functionality, if its deleted
# of modified and no longer working fog WONT be able fo start any
# kind of tasks that involve backup or restores bear in mind
# that removing or modifing this file may disable FOG system
# entirely be careful!!!!
# ==================== IMPORTANT ======================
# Sync folders /tftpboot/ and the http counterpart /var/www/html/fogimg/
function sync
{
rsync -avz --delete /tftpboot/ /var/www/html/fogimg/
}
# runs sync 5 times per minute, syncs then sleeps 10secs then repeat
# 5 more times and die. We only run it 5 times, cause 10 secs later cron
# will create the process again cause 1 minut have passed :) this will
# effectivly run this 6 times per minute, once every 10 secs
function loopMe
{
#sync
#sleep
for i in `seq 1 5`;
do
sync
sleep 10
done
}
# run it
loopMe
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment