Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Install script for GeniusTrader onto Turnkey Linux LAMP
- #
- # Add the user that is going to run GeniusTrader
- useradd --create-home --shell=/bin/bash gt
- echo "gt:password" | chpasswd
- # Create the directory where GeniusTrader is going to live, download GeniusTrader, extract from archive and tidy up, not forgetting to set gt as the owner
- mkdir /home/gt/geniustrader
- cd /home/gt/geniustrader/
- wget http://www.geniustrader.org/download/geniustrader_r690.tgz
- cd ..
- tar xfz geniustrader/geniustrader_r690.tgz
- cd geniustrader/
- rm -rf Windows_Installer/
- cd ..
- chown -R gt:gt geniustrader
- # Download and install the pre-requisites
- apt-get -y install libdate-calc-perl libgetargs-long-perl libxml-libxml-perl libcompress-zlib-perl libdate-manip-perl libgd-gd2-perl beancounter
- su - gt -c "echo yes | cpan GD"
- # Setup MySQL
- mysql -u root -ppassword -e "grant all privileges on *.* to gt@localhost"
- # Setup beancounter
- su - gt -c "setup_beancounter -m -s; update_beancounter -m"
- # Download some data to get started with
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter addstock IBM"
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter backpopulate --prevdate '20 year ago' --date 'today' IBM"
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today"
- # Setup cron to download latest data every 4 hours into beancounter
- var="(crontab -l; echo \"0 */4 * * * beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today\") | crontab -"
- su - gt -c "$var"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement