I Want to set a script and use a cronjob to take a backup of all the repositories.
FYI...
RVM Version: 1.20.13, Ruby Version: 1.9.3p429, Gem Version: 1.8.25, Bundler Version:1.3.5, Rake Version: 10.0.4, GitLab information Version: 5.3.0
I Tried the methods below, but they didn't work. Please help me to set the required cronjob. When I execute the commands manually they were working fine.
Method 1:
#!/bin/bash
cd /home/git/gitlab/
bundle exec rake gitlab:backup:create RAILS_ENV=production
Error:
bundle: command not found
Method 2:
#!/bin/sh
cd /home/git/gitlab/
bundle exec rake gitlab:backup:create RAILS_ENV=production
Error:
/bin/sh: bundle: command not found
Method 3:
10 10 * * * cd /home/git/gitlab && PATH=$PATH:$/home/git/.rvm/gems/ruby-1.9.3-p429/bin:/home/git/.rvm/gems/ruby-1.9.3-p429@global/bin:/home/git/.rvm/rubies/ruby-1.9.3-p429/bin:/home/git/.rvm/bin::/home/git/.rvm/rubies/ruby-1.9.3-p429/.irbrc bundle exec rake gitlab:backup:create RAILS_ENV=production CRON=1 >> /tmp/git_bck.log 2>&1
Error:
/home/git/.rvm/gems/ruby-1.9.3-p429@global/bin/ruby_noexec_wrapper:7:in `require': no such file to load -- rubygems (LoadError) from /home/git/.rvm/gems/ruby-1.9.3-p429@global/bin/ruby_noexec_wrapper:7