ancron startet Job nicht

  • Hallo,



    ich habe folgendes Problem, und zwar habe ich einen Anacron-Job angelegt der meine Dokumentenfreigabe von meinem Openmediavaultserver auf eine SynologyNAS sichert, das ganze geschieht mit rsync. Der Job ist folgendermaßen angelegt: schicke ein Wol-Paket zum SynologyNAS, warte 3 Minuten und synce dann die Freigabe. Starte ich diesen Job manuell, läuft das ganze ohne Fehlermeldung durch, wenn anacron den Job selber erledigen soll, bekomme ich eine Benachrichtigung per Mail, die sagt: " /bin/sh: jobbezeichnung: 1: not found".
    Lege ich einen Job an der einfach nur ein WakeOnLan Signal zum SynologyNAS schicken soll, ist es das gleiche - manuell funktioniert es, soll anacron es selber machen (nach Anschalten des Servers am nächsten Tag) funktioniert es nicht und ich bekomme die selbe Fehlermeldung. Ich habe online nichts gefunden was mir weiterhilft. Das Thema Openmediavault und Linux an sich ist ziemlich neu für mich, aber die Lernkurve ist steil und ich habe Spaß dabei. Vielleicht kann mir jemand helfen.




    Hello,
    first - sorry for my bad english. I have the following problem with anacron. I have created an anacron job that sync my shared folder from my openmediavaultserver to a synology nas, all done with rsync. The job is set up as follows: send a wol package to synology nas, wait 3 minutes and then sync the folder. If I start this job manually, it works without an error message, if anacron is to do the job itself, I get a notification by mail, which says: "/bin/sh: jobname: 1: not found". If I set up a job that just send a wol magic paket to the synology nas, it's the same - it works manually, when anacron should do it (after turning on the server the next day) it will not work and I get the same error message. I haven´t found anything online that will help me. The topic openmediavault and Llnux itself is pretty new to me, maybe someone can help me.

  • Do you mean from CLI or when pressing the "run" button?

    Both, when i press the "run" botton and via shellinabox from command line.


    The Job looks like this:


    #!/bin/bash
    set -e
    wakeonlan **:**:**:**:**:**
    sleep 3m
    rsync -avP -e ssh --no-g --delete /srv/dev-by-label-*****/*****/ user@***.**.**.**::Folder



    The * are anonymized MAC ,ip-adress and path.



    You mean the path to rsync? Can u say me the path to rsync, is it /usr/bin/?
    Thanks

    • Offizieller Beitrag

    With which rsync the system tells you the path. It is /usr/bin/rsync as you mentioned.


    Have you tried to add the complete path to the script in the anacron job?
    For example /usr/local/bin/backup.sh if the script is placed in /usr/local/bin/


    Is the script executable?
    https://askubuntu.com/question…t-can-be-run-from-termina

  • It works now, was really the path.


    Today i turned on the server and little later i got the notification:sending magic packet to 255.255.255.255 with **:**:**:**:**sending incremental file list./deleting ***/***/deleting ****/*****/****/****** 1,992 100% 0.00kB/s 0:00:00 1,992 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=1/2908)sent 70,648 bytes received 414 bytes 28,424.80 bytes/sec



    Thank you very much

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!