2

I have a shell script that contains a single rsync command to rsync two local directories. I want the script to run at startup/during boot and I can't seem to find the solution for this problem.

The file is marked as executable. I tried adding it to init.d and symlinking to rc2.d as I have seen suggested elsewhere. I tried running the script as a startup application from Gnome, and I've tried adding it to rc.local. None of these options seem to start the rsync command.

How can I achieve my goal of starting this rsync command at startup or during boot with root?

Hastur
  • 3,860
  • 2
  • 29
  • 39
KinsDotNet
  • 103
  • 9
  • 2
    Did you try `cron`? Read http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job and then use `sudo crontab -e` with `@reboot` instead of a time specification. – muru Aug 04 '14 at 03:25
  • Did you put `#!/bin/sh` or `#!/bin/bash` as first line of the script? Try in any case to specify the full path `/usr/bin/rsync` in the script. – Hastur Aug 04 '14 at 07:07
  • You can find hints in [How to run scripts on start up?](http://askubuntu.com/questions/814/how-to-run-scripts-on-start-up) or in [How to run a shell script at startup](http://stackoverflow.com/questions/12973777/how-to-run-a-shell-script-at-startup). – Hastur Aug 04 '14 at 07:14

0 Answers0