sonerezh
sonerezh copied to clipboard
Automatic Import
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
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.
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.
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 :)