Created
October 20, 2011 16:27
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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