Rysnc Job Will Not Run Automatically

  • I upgraded my backup server to OMV6 about a month ago from scratch. I reset everything from notes and pics and yet I have one rsync job that will not run automatically. Three others work perfectly. I have four remote/pull rsync jobs to back up my main server: appdata, data, media, and nextcloud. Only appdata fails to run on schedule, but it will rsync manually when started from the GUI. This is a version 1 NanoPi M4 and all it does is backup four shares from my main server. No containers, no bells and whistles, just rsync, and rsnapshot. Here are pics of my appdata settings:



    Here are pics of my data settings:



    All four shares are root:users and 775. I cannot see any difference in these four rsync jobs, yet my appdata share will not run automatically, only manually. Does anyone know what's going on here?

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Post the output of:


    cat /etc/cron.d/openmediavault-rsync


    and


    grep appdata /var/lib/openmediavault/cron.d/*


    How do you know it is not running and not failing?

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Well….

    I get Mail notifications on the three successful jobs every day, nothing on the fourth job.


    I’m out of the house right now. I’ll run the commands as soon as I get back inside. Heat index: 101° F.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • The last job listed above - 45 21 * * * root - is a second rsync for appdata that I created a couple of days ago just to see if it might run automatically. It didn't.

    Code
    wayne@m4:~$ sudo grep appdata /var/lib/openmediavault/cron.d/*
    [sudo] password for wayne: 
    /var/lib/openmediavault/cron.d/rsync-67ea269c-e657-4633-b3cb-9501637b4a79:omv_log "Please wait, syncing <rsync://wayne@192.168.1.140/appdata> to </srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/> ...\n"
    /var/lib/openmediavault/cron.d/rsync-67ea269c-e657-4633-b3cb-9501637b4a79:rsync --verbose --log-file="/var/log/rsync.log" --recursive --perms --times --group --owner --delete --acls --xattrs --partial "rsync://wayne@192.168.1.140/appdata" "/srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/" & wait $!
    /var/lib/openmediavault/cron.d/rsync-e1016dfb-369c-491d-8ab5-10e11977b9e6:omv_log "Please wait, syncing <rsync://wayne@192.168.1.140/appdata> to </srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/> ...\n"
    /var/lib/openmediavault/cron.d/rsync-e1016dfb-369c-491d-8ab5-10e11977b9e6:rsync --verbose --log-file="/var/log/rsync.log" --recursive --perms --times --group --owner --delete --acls --xattrs --partial "rsync://wayne@192.168.1.140/appdata" "/srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/" & wait $!

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Somehow my post did not make it through.


    I think it is running, but fails or the mail is not delivered. Everything looks fine for me.


    Can you add touch <some/file> &&  in front of the command in line 7 in /etc/cron.d/openmediavault-rsync to have an indication if something is happening? Later you can check the timestamp of that file and see when it was toched the last time.


    Check the mail queue if the mail gets stuck for some reason. You have verbose turned on, so the output might get large.



    You are running the jobs in 20 Min distance. Do they complete before that, as they all use the same log file.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • The jobs all run within a few minutes. None of them take more than 10.


    Now if I add that touch command won’t it get overwritten?

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Found my last post, was on my mobile not being sent


    If you edit the file and do not apply anything in the ui it will stay. it is only to diagnose what is going on.


    If you feel comfortable with editing scripts, you can edit the script file too to put debug "messages" in.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Zoki I tried inserting the touch command in front of the line 7 command above, but never saw any timestamp change in the command line.


    I tried a "low tech" test by creating two different text files and placing one in appdata on my main server, and the other in appdata on my backup server. Here's the thought: if the rsync job runs then the file from the main server will be copied over to the backup server, and the other file will be deleted from the backup server. That didn't happen, so the rsync job is just not running automatically.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • can you post the file again.

    What you say means cron is not even trying to execute only this command in the file. But how would cron know this is the evil job not to execute?

    This is a mystery.


    The "low tech" test woul only show a result, if the rsync ran without an error.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • I’m not sure I follow you. Which file do you want me to re-post?

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Okay, here's what I pasted in front of the appdata rsync cron job (line 6) of openmediavault-rsync:

    Code
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    # m h dom mon dow user    command
    0 22 * * * root touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/test-from-ts140.txt /var/lib/openmediavault/cron.d/rsync-e1016dfb-369c-491d-8ab5-10e11977b9e6 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    20 22 * * * root /var/lib/openmediavault/cron.d/rsync-ef913ce5-8652-45e1-993b-0895b7cb4834 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    40 22 * * * root /var/lib/openmediavault/cron.d/rsync-eacf2c2c-d698-40b7-9a67-f384de69438b 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    0 23 * * * root /var/lib/openmediavault/cron.d/rsync-dadb9713-ad1a-4ccd-b1c1-24d59763dcc1 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1

    Here is the ls of the file to be touched:

    Code
    -rwxrw-r--  1 wayne users   27 Jun 19 19:51 test-from-ts140.txt

    So, your are saying to look for a timestamp change for this file the next time I ssh in, sometime after 10:15 or so this evening. Is that correct?

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Line 6 should be

    Code
    0 22 * * * root touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/test-from-ts140.txt && /var/lib/openmediavault/cron.d/rsync-e1016dfb-369c-491d-8ab5-10e11977b9e6 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1

    Note the two && to concatenate the commands.


    You can even try to add the complete path to touch:

    Code
    pi@multipi:~ $ which touch
    /usr/bin/touch

    which makes it

    Code
    0 22 * * * root /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/test-from-ts140.txt && /var/lib/openmediavault/cron.d/rsync-e1016dfb-369c-491d-8ab5-10e11977b9e6 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1

    and add an additional line

    Code
    1 22 * * * root /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/simple-test.txt

    There is no need to create the file to be touched, it will be done automatically.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Dang. I forgot the &&. How's this:

    Code
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    # m h dom mon dow user    command
    0 22 * * * root /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/simple-test.txt && /var/lib/openmediavault/cron.d/rsync-e1016dfb-369c-491d-8ab5-10e11977b9e6 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    1 22 * * * root /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/simple-test.txt
    20 22 * * * root /var/lib/openmediavault/cron.d/rsync-ef913ce5-8652-45e1-993b-0895b7cb4834 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    40 22 * * * root /var/lib/openmediavault/cron.d/rsync-eacf2c2c-d698-40b7-9a67-f384de69438b 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    0 23 * * * root /var/lib/openmediavault/cron.d/rsync-dadb9713-ad1a-4ccd-b1c1-24d59763dcc1 2>&1 | grep -v '/$' | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Looks good, now wait for the evening.


    Did you test it by running it on the console?

    Code
    /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/simple-test.txt

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Did you test it by running it on the console?

    No but I will.


    I have my main machine on OMV6 as well now. I was thinking that might fix things, but it didn’t.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Here you go:

    /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/simple-test.txt

    gave me:

    -rw-r--r-- 1 wayne users 0 Jun 23 12:08 simple-test.txt

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Here you go:

    /usr/bin/touch /srv/dev-disk-by-uuid-37dd804f-7c6e-4cf7-9588-3e098589a01a/appdata/simple-test.txt

    gave me:

    -rw-r--r-- 1 wayne users 0 Jun 23 12:08 simple-test.txt

    If I am not mistaken about the timezone you are in this is correct.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Central Daylight Savings.

    Running /usr/bin/touch created that file at 12:08 CDST.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!