UPDATE: 6/22/2013
THIS UTILITY IS OBSOLETE. PLEASE USE THE FAHINSTALL SCRIPT FOR YOUR LINUX FAH INSTALLS, WHICH ALSO HANDLES BACKUPS
===========================================================================================================
This is based on foxtrotniner's original backup script. I made it more generic for different Linux installs. It should be distro-independent (note: this did not work on my Arch install due to permission for editing crontab. If you run into this for other distros, let me know. If you know how to fix it, also let me know.) It is only for Linux installs, either native or in a VM. The script sets up a cron job that runs every three hours. This job;
1. Saves off the previous backups and removes any older backups
2. Backs up the work directory, queue.dat, and unitinfo.txt
3. Waits 60 seconds, then backs everything up again in case checkpoint were being written during the first backup
To install this, log in as the user you use to run FAH and change to you FAH directory. If you used the Ubuntu install guide, this would be
Run the following to download the install script (fahbkup.sh), make it executable, and run it (note: do not run this as root or use sudo in front of anything - you have to be logged in as the fah user):
Once this finishes, nothing else is required. You may see a "no crontab for user" message when installing. This is fine. You can verify the install by checking a couple of things.
1. Typing crontab -l should return something like this:
2. Typing ls should show these 5 new files:
backup.sh
restorebk.sh
restore.sh
start
stop
You should also have two new directories:
backup
cron
If all of this is in place, the install was successful and you are backing up your WU every three hours.
I also added a start and stop script. The start script will start FAH in a detached screen. You must have screen installed for it to work. For Ubuntu, you probably already have it. To check, type:
You also need to have your flags (-smp, -bigadv, -bigbeta, etc.) set up in the config file. To run the script, type this from the fah directory:
Type screen -r to see this new screen. Hold down the Control key and press A then D to detach from it.
The stop script is similar - run it by typing
This script will back up the WU twice, then stop fah. It assumes your folding executable is named fah6. If yours is not, let me know and I will show you what to change.
If you have a problem with your checkpoints when restarting a WU, you can restore to the previous backup with the restore scripts. restore.bk restores to the first saved copy. restorebk.sh restores to the second copy. You only need to run one. If one doesn't work, try the other. You run them like any other script:
Performance implications: Every three hours, one core of your machine will be used for a short period of time to create the backup. How long depends on hardware. My 1.8 GHz Magny Cours machine takes around 30 seconds for each bigbeta backup. That is probably worst case since my clock speed is low, my hdd is just an old SATA drive, and bigbetas are the largest units. I doubt you will notice, but there certainly will be some performance implications. The cron job interval can be increased from every three hours if this is a problem for you. Just let me know.
Please post or pm me with any comments, feedback, or enhancement requests.
THIS UTILITY IS OBSOLETE. PLEASE USE THE FAHINSTALL SCRIPT FOR YOUR LINUX FAH INSTALLS, WHICH ALSO HANDLES BACKUPS
===========================================================================================================
This is based on foxtrotniner's original backup script. I made it more generic for different Linux installs. It should be distro-independent (note: this did not work on my Arch install due to permission for editing crontab. If you run into this for other distros, let me know. If you know how to fix it, also let me know.) It is only for Linux installs, either native or in a VM. The script sets up a cron job that runs every three hours. This job;
1. Saves off the previous backups and removes any older backups
2. Backs up the work directory, queue.dat, and unitinfo.txt
3. Waits 60 seconds, then backs everything up again in case checkpoint were being written during the first backup
To install this, log in as the user you use to run FAH and change to you FAH directory. If you used the Ubuntu install guide, this would be
Code:
cd ~/fah
Code:
wget "http://musky.dyndns.info:8088/fah/fahbkup-0.2.sh"
chmod 755 fahbkup-0.2.sh
./fahbkup-0.2.sh
Once this finishes, nothing else is required. You may see a "no crontab for user" message when installing. This is fine. You can verify the install by checking a couple of things.
1. Typing crontab -l should return something like this:
Code:
0 */3 * * * /home/dave/fah/backup.sh
backup.sh
restorebk.sh
restore.sh
start
stop
You should also have two new directories:
backup
cron
If all of this is in place, the install was successful and you are backing up your WU every three hours.
I also added a start and stop script. The start script will start FAH in a detached screen. You must have screen installed for it to work. For Ubuntu, you probably already have it. To check, type:
Code:
sudo apt-get install screen
Code:
./start
The stop script is similar - run it by typing
Code:
./stop
If you have a problem with your checkpoints when restarting a WU, you can restore to the previous backup with the restore scripts. restore.bk restores to the first saved copy. restorebk.sh restores to the second copy. You only need to run one. If one doesn't work, try the other. You run them like any other script:
Code:
./restore.sh
Performance implications: Every three hours, one core of your machine will be used for a short period of time to create the backup. How long depends on hardware. My 1.8 GHz Magny Cours machine takes around 30 seconds for each bigbeta backup. That is probably worst case since my clock speed is low, my hdd is just an old SATA drive, and bigbetas are the largest units. I doubt you will notice, but there certainly will be some performance implications. The cron job interval can be increased from every three hours if this is a problem for you. Just let me know.
Please post or pm me with any comments, feedback, or enhancement requests.
Last edited: