Raspberry Pi Auto-Start Python using Cron

nano start.sh

#!/bin/sh
cd /
cd home/pi
sudo python test.py
cd /

chmod 755 start.sh

mkdir logs

sudo crontab -e
last line:
@reboot sh /home/pi/start.sh >/home/pi/logs/cronlog 2>&1

Using this way, we create a one-time only cron. Note that it works in background.

Advertisements

Raspberry Pi SMB (Samba)

sudo apt-get install samba samba-common-bin
sudo nano /etc/samba/smb.conf

security = user

insert last line:

[Elements]
comment = External Drive
path = /mnt/usbel
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

run:

sudo smbpasswd -a pi

restart:

sudo service samba restart