scheduled task qnap

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
Wezuwiusz
Posts: 8
Joined: 10 Jun 2019, 01:38

scheduled task qnap

Post by Wezuwiusz »

Hey i would like to get help so i can make filebot run automatically every day in early hours, im not an advanced user so i would need step by step guide, been using filebot for some time now but would like to make it more self acting.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: scheduled task qnap

Post by rednoah »

Unfortunately, QNAP doesn't make scheduled tasks particularly user-friendly. You will need basic command-line skills, SSH, cron, displaying and editing files, IO redirection, etc.


:!: If you have never used SSH, you will find this task extremely difficult (especially if it doesn't just work immediately for some reason) even though it might be simple for advanced users. I highly recommend inviting a Linux-savvy friend over for help.


I'd start by using FileBot Node, and from that point on, you will find reading this thread most helpful:
viewtopic.php?f=3&t=10947#p45119
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: scheduled task qnap

Post by rednoah »

By far the easiest semi-solution is to create a Scheduled Task in FileBot Node, and then execute it on-demand by pasting the given url into your browser. Adding a bookmark will make this a on-click solution.
:idea: Please read the FAQ and How to Request Help.
Wezuwiusz
Posts: 8
Joined: 10 Jun 2019, 01:38

Re: scheduled task qnap

Post by Wezuwiusz »

thanks for your help guys i think i've managed to add the task to crontab but the other easy solution will be handy time to time too
Wezuwiusz
Posts: 8
Joined: 10 Jun 2019, 01:38

Re: scheduled task qnap

Post by Wezuwiusz »

I've had 1 film to process and it didnt do it, but the films which has been processed before it must of have gone through filebot again because folder name has changed from 'Forrest gump (1994)' to 'Forrest gump 1994' so the brackets are missing from the folder name but the file it self is unchanged but that can confuse plex with meta-agent which it has with 1 film which previously had all the meta-data on plex but overnight it was gone, cant see the log in filebot node and over ssh i cant access log file from filebot as it giving me premission denied even tho i'm logged as an admin
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: scheduled task qnap

Post by rednoah »

The log will tell what's going on. You can set your own --log-file location. I'd pick a log file location that you can find and view easily, e.g. in your --output folder.

If you've created a prepared task via FileBot Node, then it's configured to write the log into a known location, so that FileBot Node can show you when you click on the task in the task list. So you should always be able to access your logs via FileBot Node at least.

If you can't see files when logged in via SSH, then that's generic Linux. Google will help. You'll probably be able to use sudo to get temporary root permissions to see system files that your normal admin user usually doesn't have access to.
:idea: Please read the FAQ and How to Request Help.
Wezuwiusz
Posts: 8
Joined: 10 Jun 2019, 01:38

Re: scheduled task qnap

Post by Wezuwiusz »

hi again, so my question is why crontab is runing every minute from 6am to 7am i have added this entry to the crontab:

Code: Select all

* 6 * * * /opt/filebot-node/task 5
for me it should run once at 6am everyday and thats what i want it to do.
The whole list of my cron jobs:

Code: Select all

[~] # crontab -l
# m h dom m dow cmd
0 2 * * * /sbin/qfstrim
37 9,21 * * * /sbin/notify_update --nc 1>/dev/null 2>&1
0-59/20 3 * * * /sbin/adjust_time
0 1 * * * /etc/init.d/flush_memory.sh >/dev/null 2>&1
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
*/10 * * * * /sbin/config_cache_util 0
0 3 * * 0 /etc/init.d/idmap.sh dump
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
47 3 * * * /bin/sh /etc/init.d/disk_data_collection.sh
50 * * * * /sbin/qddns_check 2>/dev/null
* * * * * /var/cache/netmgr/lock_timer.sh
0 4 * * * /etc/init.d/wsd.sh restart
4 3 * * 3 /etc/init.d/backup_conf.sh
0 0 * * * /usr/local/sbin/qsh nc.archive >/dev/null 2>&1
0 12 * * * /mnt/ext/opt/LicenseCenter/bin/qlicense_tool local_check
15 03 * * * /mnt/ext/opt/QcloudSSLCertificate/bin/ssl_agent_cli
* 6 * * * /opt/filebot-node/task 5
Wezuwiusz
Posts: 8
Joined: 10 Jun 2019, 01:38

Re: scheduled task qnap

Post by Wezuwiusz »

I figured it out that i need to change

Code: Select all

* 6 * * * /opt/filebot-node/task 5
to

Code: Select all

0 6 * * * /opt/filebot-node/task 5
but i dont know how to save the change, i logged in throuh ssh and changed the line pressed 'esc' and what next? if i close putty it wont save the change and i'm unable to write any other command as it keeps beeping when i do and if i switch to insert mode i'm guessing it still editing the cron im confused
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: scheduled task qnap

Post by rednoah »

Maybe a vi tutorial will help?
https://www.guru99.com/the-vi-editor.html
:idea: Please read the FAQ and How to Request Help.
Wezuwiusz
Posts: 8
Joined: 10 Jun 2019, 01:38

Re: scheduled task qnap

Post by Wezuwiusz »

Ok so I've finally managed to edit, maybe this will help other people who dont really are into ssh command.

Code: Select all

vi /etc/config/crontab
changed the

Code: Select all

* 6 * * * /opt/filebot-node/task 5
to

Code: Select all

0  6 * * * /opt/filebot-node/task 5
then to save and quit

Code: Select all

:wq
after that

Code: Select all

/etc/init.d/crond.sh restart
and just in case

Code: Select all

crontab /etc/config/crontab && /etc/init.d/crond.sh restart
and it's saved for good which should do the auto run of filebot at 6am just once not every minute like before
JK123
Posts: 1
Joined: 29 Sep 2021, 06:56

Re: scheduled task qnap

Post by JK123 »

searching for the guidance in quite similar path
gulshannegi
Posts: 1
Joined: 21 Nov 2021, 13:52

Re: scheduled task qnap

Post by gulshannegi »

Wezuwiusz wrote: 15 Nov 2019, 13:57 Ok so I've finally managed to edit, maybe this will help other people who dont really are into ssh command.

Code: Select all

vi /etc/config/crontab
changed the

Code: Select all

* 6 * * * /opt/filebot-node/task 5
to

Code: Select all

0  6 * * * /opt/filebot-node/task 5
then to save and quit

Code: Select all

:wq
after that

Code: Select all

/etc/init.d/crond.sh restart
and just in case

Code: Select all

crontab /etc/config/crontab && /etc/init.d/crond.sh restart
and it's saved for good which should do the auto run of filebot at 6am just once not every minute like before
yes I agree with the rednoah vi editors will help you to edit the file You can open the file again using vi helloworld.txt and then use cat /path/your_file to view it.
some of the best Vi Editors commands is:
i – this command will allow you to Insert wherever your cursor is (goes into insert mode)
a – it will allow you to write just after the cursor (goes into insert mode)
A – it will allow you to write at the end of the line (goes into insert mode)
ESC – this will allow you to exit the insert mode
u – it will allow you to undo the last change
U – it will allow you to undo all changes to the entire line
o – it will allow you to open a new line (goes into insert mode)
dd – it will allow you to delete the specific line
3dd – it will allow you to delete 3 consecutive lines.
D – it will allow you to delete the contents of the line just after the cursor
C – it will allow you to delete the contents of a line just after the cursor and allow you to insert new text. You can press the ESC key if you want to end insertion mode.
dw – it will allow you to delete the specific word.
4dw – it will allow you to delete 4 consecutive words
cw – it will allow you to change the specific word
x – it will allow you to delete the specific character at the cursor
r – it will allow you to replace the specific character
R – it will allow you to overwrite the characters just from the cursor onward
s – it will allow you to substitute one character just under the cursor and then continue to insert
S – it will allow you to substitute the entire line and begin to insert just at the beginning of the line
~ – it will allow you to change the case of a specific character
Life does not allow a second chance so make it perfect in the first attempt
Post Reply