Page 1 of 1

update script at boot

Posted: Sat Mar 19, 2016 7:41 am
by Alexandre34
Hello
I am newbie with Linux (raspian jessie), and need an advice:
How make this task done at boot:
IF file /home/pi/ftp/player_new exists
THEN copy /home/pi/player in /home/pi/player_old
THEN copy /home/pi/ftp/player_new in /home/pi/player
THEN remove /home/pi/ftp/player_new
THEN give execute rights to /home/pi/player

I knows the commands to use (sudo,cp,rm,chmod)
What I dont know is the "logic" part (if, then) and the proper way to execute this script at boot time
If an advanced user have an advice...

Re: update script at boot

Posted: Sat Mar 19, 2016 10:29 am
by DirkS
See e.g. http://ryanstutorials.net/bash-scriptin ... ements.php for info on the if statement.
There are options for checking the existence of files, directories, etc (also mentioned on linked page).

I wouldn't bother with auto-starting until you get the script itself working.