Exoon
Exoon

Reputation: 1553

Is this the correct way to setup a cron on Synology NAS Terminal

Im trying to setup my script which downloads files to my PC, I want it to run every minute it doesn't seem to be working at the moment.

When i run the command in terminal the file downloads perfectly.

enter image description here

Full Image: https://i.sstatic.net/opxNt.png

Upvotes: 0

Views: 3599

Answers (2)

Toi Lee
Toi Lee

Reputation: 171

You can install bootstrap(If your NAS model support bootstrap) and then install ipkg, then install crond. This crond work well like any other linux, unix systems.

Do not use the default crontab of synology DSM.

Upvotes: 0

flurdy
flurdy

Reputation: 3972

* * * * * root /usr/bin/php argument

will run every minute. But passing arguments into a command inside cron is not something I would recommend. Why not create a very simple shell script:

vi /usr/local/bin/myphpthing

that includes just this

/usr/bin/php myarguments

make the file executable

chmod +x /usr/local/bin/myphpthing

And create a cronjob like this

* * * * * root /usr/local/bin/myphpthing

Do remember to restart crontab service otherwise these changes will not be picked up. Alternatively just restart the box.

In addition running something every minute on a Synology NAS box is perhaps not something I would recommend. The disks will then never suspend. And whatever your php script does might sometimes not finish in time for the next to start and you might then have conflicts and locks.

Upvotes: 1

Related Questions