run_program_at_boot_using_cron
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
run_program_at_boot_using_cron [2017/01/31 16:39] – [Introduction] walkeradmin | run_program_at_boot_using_cron [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
\\ | \\ | ||
\\ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | |||
===== Introduction ===== | ===== Introduction ===== | ||
I was using the .bashrc file when logged in as a user (from your home directory, type sudo nano .bashrc) to launch scripts upon the Raspberry Pi bootup. However, while this works, its has one really annoying issue. If you login from another place, say from SSH, then the script runs again, which isn't great for my application. | I was using the .bashrc file when logged in as a user (from your home directory, type sudo nano .bashrc) to launch scripts upon the Raspberry Pi bootup. However, while this works, its has one really annoying issue. If you login from another place, say from SSH, then the script runs again, which isn't great for my application. | ||
Line 14: | Line 19: | ||
\\ | \\ | ||
To avoid putting loads of commands in to Cron, its best to group them all in to a file, then just reference that file in Cron. For this example we will make a file called <color red> | To avoid putting loads of commands in to Cron, its best to group them all in to a file, then just reference that file in Cron. For this example we will make a file called <color red> | ||
- | \\ | ||
\\ | \\ | ||
Line 59: | Line 63: | ||
sudo chmod 755 launcher.sh | sudo chmod 755 launcher.sh | ||
</ | </ | ||
- | \\ | ||
---- | ---- | ||
Line 103: | Line 106: | ||
@reboot sh / | @reboot sh / | ||
</ | </ | ||
- | \\ | ||
\\ | \\ | ||
When you boot/reboot your Raspberry Pi, this will now run the launcher.sh, | When you boot/reboot your Raspberry Pi, this will now run the launcher.sh, | ||
Line 117: | Line 119: | ||
\\ | \\ | ||
http:// | http:// | ||
+ | |||
+ | ---- | ||
+ | |||
\\ | \\ | ||
\\ | \\ | ||
run_program_at_boot_using_cron.1485880755.txt.gz · Last modified: 2023/03/09 22:35 (external edit)