#Create camera service
- Create file /etc/systems/system/camera.service
[Unit] Description=Flood Camera FTP Scan # Requires=mysqld.service memcached.service After=network.target [Service] User=username Group=groupname Type=simple TimeoutSec=0 PIDFile=/var/run/php_camera_scan.pid WorkingDirectory=/folder/to/working ExecStart=/usr/local/php72/bin/php -f /folder/to/file.php 2>&1 > /folder/to/store/log/file.log KillMode=mixed Restart=on-failure RestartSec=42s [Install] WantedBy=default.target
#Run service
systemctl start camera systemctl stop camera systemctl restart camera