[SOLVED] moving motion mpeg and jpeg files to a XU4

Post Reply
richard-g8jvm
Posts: 428
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 2 times
Contact:

[SOLVED] moving motion mpeg and jpeg files to a XU4

Post by richard-g8jvm »

I was running Motion on the XU4 until I stupidly upgraded to ubuntu20
That plus changes to motion meant the c270 cam on the USB port would no longer function
As I also use the XU4 with HomeAssistant I didnt regress back in case HA got screwed up and its getting too cold to lose control of the heating.
So I moved Motion to the C2 which normally just runs Kodi
With ubuntu18 and motion 4.0 , no problem with the cameras
BUT the daily download of mpegs and jpegs takes ages with SCP , that process on the XU4 was much faster

So looking for a way that Motion will store its mpegs and jpegs on the XU4, especially as a few days videos is enough to cause the C2 to fall over.
I'm not sure if I can store directly to the Xu4 from the C2.
Maybe better to use crontab to hourly copy from the C2 to XU4, then delete the directory contacts on the C2

or is there a better way of doing it ???????
thanks
Last edited by richard-g8jvm on Mon Oct 19, 2020 6:21 pm, edited 1 time in total.
BR
Richard G8JVM

mad_ady
Posts: 8604
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 491 times
Contact:

Re: moving motion mpeg and jpeg files to a XU4

Post by mad_ady »

You can create a nfs share on yor xu4, use autofs on the c2 to mount it on demand. Either point motion to record directly on the nfs share, or run a simple mv through cron to move data over nfs. Should be a few times faster than over scp.

richard-g8jvm
Posts: 428
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 2 times
Contact:

Re: moving motion mpeg and jpeg files to a XU4

Post by richard-g8jvm »

Hi
I thought I try using rsync before mounting and unmounting a remote drive.

My crontab on the C2

Code: Select all


SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
/5 *    * * *   odroid    rsync -arz -e ssh /home/odroid/Pictures/motion/ odroid@192.168.1.82:/home/odroid/Pictures/motion
#10 16   * * *   root    rm -f /home/odroid/Pictures/motion/*
/5 *    * * *   odroid  rsync -arz -e ssh /home/odroid/Pictures/motion2/ odroid@192.168.1.82:/home/odroid/Pictures/motion2
#17 16   * * *   root    rm -f /home/odroid/Pictures/motion2/*
/5 *    * * *   odroid  rsync -arz -e ssh /home/odroid/Pictures/motion3/ odroid@192.168.1.82:/home/odroid/Pictures/motion3
#25 16   * * *   root    rm -f /home/odroid/Pictures/motion3/*

each of the rsync line run without a problem when run from CLI
I've tried user as root and odroid, neither work from crontab.

ignore the hashed out lines, they are just to clean up daily
cron is running and ssl tokens are loaded on the other machine , ssh to the XU4 doesn't ask for a password

where's the screw up ????
BR
Richard G8JVM

richard-g8jvm
Posts: 428
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 2 times
Contact:

Re: [SOLVED] moving motion mpeg and jpeg files to a XU4

Post by richard-g8jvm »

the last line in crontab MUST be a
#
on its own , nothing after or before it, otherwise the crontab edit is ignored
These users thanked the author richard-g8jvm for the post:
odroid (Mon Oct 19, 2020 6:30 pm)
BR
Richard G8JVM

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 3 guests