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?
cron
? Read http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job and then usesudo crontab -e
with@reboot
instead of a time specification. – muru Aug 04 '14 at 03:25#!/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