sonerezh icon indicating copy to clipboard operation
sonerezh copied to clipboard

Automatic Import

Open azN2 opened this issue 9 years ago • 3 comments

Is it currently possible or can it become possible to have my library automatically import every :15minutes or so when new files are added to the directory? like a cron job

azN2 avatar Jun 10 '16 01:06 azN2

You could make it yourself with something like this, which uses the Sonerezh command line tool:

/etc/systemd/system/sonerezh.service

[Unit]
Description=Sonerezh Import
[Service]
Type=oneshot
ExecStart=/srv/http/sonerezh/app/Console/cake sonerezh import /mnt/hdd/music

/etc/systemd/system/sonerezh.timer

[Unit]
Description=Hourly import of new songs in Sonerezh
[Timer]
OnCalendar=hourly
Persistent=true

[Install]
WantedBy=timers.target 

systemctl enable sonerezh.timer

Disclaimer: assumes a distro using systemd, and I have NOT tested this.

ltguillaume avatar Jun 10 '16 21:06 ltguillaume

hi,

you also can use inotify with incrontab and monitor changes in your library directory.

incrontab looks like /my/library IN_MODIFY /Sonerezh/Console/cake sonerezh import /my/library

Sonerezh has a lock system to prevent multiple import processes so it should be ok.

tititototutu avatar Jun 13 '16 12:06 tititototutu

Hi @krenken

Did you test a crontab or systemd timer like @ltGuillaume suggested? If it works for you we could close the issue and improve the documentation :)

lGuillaume124 avatar Sep 17 '16 10:09 lGuillaume124