# Scheduling daily import on Synology

**URL:** <https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154>\
**Category:** Help\
**Created:** [September 10, 2022, 2:00am UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154 "2022-09-10T02:00:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sallysensation](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sallysensation](https://discourse.beets.io/u/sallysensation)\
**Post date:** [September 10, 2022, 2:00am UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/1 "2022-09-10T02:00:49Z")

</div>

I’m wondering if there is a way to use synology’s task scheduler to run beets (which I have installed in a docker container) on a regular schedule, perhaps daily.

I’m not great with command line or scripting but can muddle my way through it. I just need a little direction.

I have a folder on my Synology NAS which contains newly downloaded music. I would like to automate the process of having beets tag and organize/move the files into my music library.

---

<div class="post-metadata">

**Author:** ![jackwilsdon](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jackwilsdon/32/10_2.png) [@jackwilsdon](https://discourse.beets.io/u/jackwilsdon)\
**Post date:** [September 10, 2022, 11:21am UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/2 "2022-09-10T11:21:33Z")

</div>

If you can schedule shell commands, you should be able to run an import with `-q` (quiet) to tell beets to import without asking for user input.

If you haven’t got beets set to move imported files, you’ll also want the `-i` (incremental) flag to tell beets to import only new items.

In quiet mode, beets will skip any import items which would normally require user input, but you can keep a log of these using `-l path-to-log`.

See the [import](https://beets.readthedocs.io/en/stable/reference/cli.html#import) section of the beets documentation (or run `beet import -h`) for a list of all available import options.

---

<div class="post-metadata">

**Author:** ![sallysensation](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sallysensation](https://discourse.beets.io/u/sallysensation)\
**Post date:** [September 10, 2022, 11:39am UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/3 "2022-09-10T11:39:05Z")

</div>

That’s very helpful, thank you! What would the shell command look like in the Synology task scheduler? Do I need a separate file for it to call or can I put the command directly in the task scheduler?

Also, is there a way to create something like a bookmark or shortcut on an Android device of from a browser to run an import like this with one click?

---

<div class="post-metadata">

**Author:** ![jackwilsdon](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jackwilsdon/32/10_2.png) [@jackwilsdon](https://discourse.beets.io/u/jackwilsdon)\
**Post date:** [September 10, 2022, 12:32pm UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/4 "2022-09-10T12:32:11Z")

</div>

> What would the shell command look like in the Synology task scheduler?

The command would just be whatever the normal docker command is you use to run a beets import (with the flags I mentioned above).

> Do I need a separate file for it to call or can I put the command directly in the task scheduler?

I’m not all that familiar with Synology’s task scheduler, but from their documentation it seems like you can just put the command straight in the task scheduler itself (they seem to call it a “User-defined script” on [this page](https://kb.synology.com/en-global/DSM/help/DSM/AdminCenter/system_taskscheduler?version=7)).

> Also, is there a way to create something like a bookmark or shortcut on an Android device of from a browser to run an import like this with one click?

Provided SSH access is enabled, you should be able to use something like [this app](https://play.google.com/store/apps/details?id=com.pd7l.sshbutton) (or any equivalent which allows running pre-defined commands over SSH using a shortcut) to just run the same import command you configured the scheduler to run.

---

<div class="post-metadata">

**Author:** ![sallysensation](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sallysensation](https://discourse.beets.io/u/sallysensation)\
**Post date:** [September 10, 2022, 5:10pm UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/5 "2022-09-10T17:10:21Z")

</div>

Thanks! I’ll play around with it.

That SSH button looks cool. I’m not sure how secure it is to leave SSH on.

---

<div class="post-metadata">

**Author:** ![sallysensation](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sallysensation](https://discourse.beets.io/u/sallysensation)\
**Post date:** [September 12, 2022, 3:10am UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/6 "2022-09-12T03:10:04Z")

</div>

Not having any luck getting it to run. From the command line prompt I use these commands:

$ sudo -i docker exec -i -t beets bash  
Password:

# beet import -q /downloads/test

This successfully imports new music files from my “test” folder without prompting me (quiet mode). I have the log set in my config file.

It not clear to me how to do this in synology task scheduler.

---

<div class="post-metadata">

**Author:** ![paulmcrules](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@paulmcrules](https://discourse.beets.io/u/paulmcrules)\
**Post date:** [November 17, 2022, 5:02pm UTC](https://discourse.beets.io/t/scheduling-daily-import-on-synology/2154/7 "2022-11-17T17:02:01Z")

</div>

Any luck at all here? I’m looking to do this too but trying to install another plugin before I look into to this further.

But by the looks of it, if you go into Control Panel \> Task Scheduler (scroll all the way to the bottom) \> Create \> Scheduled Task \> User-defined Script then you can firstly name the task and select what user activates the script - I would try using admin first, but perhaps root maybe needed.

Then use the Schedule tab to enter when and how often you want the script to run.

Then finally go to the Task Settings tab to enter the User Script. The example says: `bash /volume1/public/job.sh`

So this is just pointing to the script’s location that will be run, which will lead me on to my next bit of research of how to make the .sh file. Hoping it is just plain text with the normal Beets SSH command, if so then it should take no time to set up 🙂
