× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Cronjobs on ReadyNas NV+

vifferNL
Aspirant

Cronjobs on ReadyNas NV+

Hi all,

I have a securitycamera that uploads automatically images (over FTP) when it detects movement. This can result in large numbers of files (I've had more then 500.000 files :oops: ) so I want a new folder created every day and copy the files inthere. So I wrote a little script to do this for me

#! /bin/sh
mkdir /FTPupload/$(date -d yesterday +%Y.%m.%d)
find /FTPupload/ -type f -maxdepth 1 -daystart -mtime +0 -exec mv {} /FTPupload/$(date -d yesterday +%Y.%m.%d)/ \;


When I run this script manually this works fine. But I don't want to run this script manually every day, so I thought of creating a cronjob. I copied the script into the cron.daily folder and created a crontab file to activate this script

0 10 * * * /etc/cron.daily/FTPUpload_opruimen.sh


I activated this cronjob by typing

 crontab cron_jobs.txt


When I look at the running crons it appears to be active

# crontab -l
0 10 * * * /etc/cron.daily/FTPUpload_opruimen.sh


I've also checked the crontab to see if the crontab.daily folder is called

# cat crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
25 6 * * * root test -e /usr/sbin/anacron || nice run-parts --report /etc/cron.daily
47 6 * * 7 root test -e /usr/sbin/anacron || nice run-parts --report /etc/cron.weekly
52 6 1 * * root test -e /usr/sbin/anacron || nice run-parts --report /etc/cron.monthly
#



But all that happens, a new folder isn't created and my images aren't moved. In the cron.log it looks like the script is called but I can't figur out what I'm doing wrong.

Sep 21 10:00:01 QW-NAS-001 /USR/SBIN/CRON[17355]: (root) CMD (/etc/cron.daily/FTPUpload_opruimen.sh^M)
Sep 21 10:08:01 QW-NAS-001 /USR/SBIN/CRON[17539]: (root) CMD ( /usr/bin/empty_exim &>/dev/null)


I have also tried to put the script in the daily.d folder but this has no effect as well. Anyone have an idea?

Thanks!
Message 1 of 4
jenzbe
Aspirant

Re: Cronjobs on ReadyNas NV+

Hoi vifferNL,

I have a similar problem.
I had a task scheduled to copy my nzb-files automatically from one folder to another (which sabnzbd monitors).
Now AFTER the latest Radiator update this does not run anymore.
I dont think you have a problem with your script, i think they changed something we are missing.

PLZ keep me posted if u find a solluction (en sorry dat ik jou niet kon helpen)
Message 2 of 4
vifferNL
Aspirant

Re: Cronjobs on ReadyNas NV+

No worries jenzbe 😉

I still don't have the cron running as I would like (at the time I want) but I got a bit further after a lot of googling.

The ReadyNas runs all scripts in the cron.daily folder at 6:25 (this is the time in the crontab file). There is one major "but". The script shoudn't have the extension ".sh". I'm not sure about other extensions, I've removed the extension completely.

Maybe someday I will try to get a cron running at the time I want but for now it works for me.
Message 3 of 4
jenzbe
Aspirant

Re: Cronjobs on ReadyNas NV+

Hey viffer, i just noticed: i think i have the cron thingy running again.
I only adjusted the rights of the cronjob (to 755 i think).
Today it has downloaded my nzb's so i think ik works again.

You can read my old post here: viewtopic.php?f=23&t=58179
Message 4 of 4
Top Contributors
Discussion stats
  • 3 replies
  • 4300 views
  • 0 kudos
  • 2 in conversation
Announcements