<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cron pattern to copy over a USB drive]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/3975/nosql-offsite-backup">NoSQL Offsite Backup</a></p>
<p dir="auto">Hi everyone, I see in the topic from above that is possible to insert a USB drive into the MangoES box and create a cron pattern that will copy automatically the files from the backup directory over the USB drive.</p>
<p dir="auto">I'm quite novice in this area and if anybody can help me with more information about how I can do this and how I can run this cron pattern it will be very helpful.</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.mango-os.com/topic/4427/cron-pattern-to-copy-over-a-usb-drive</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 14:44:19 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4427.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Aug 2019 16:30:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:38:25 GMT]]></title><description><![CDATA[<p dir="auto">ok, Thank you a lot!</p>
]]></description><link>https://forum.mango-os.com/post/23450</link><guid isPermaLink="true">https://forum.mango-os.com/post/23450</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:38:25 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:38:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sky_watcher" aria-label="Profile: sky_watcher">@<bdi>sky_watcher</bdi></a> said in <a href="/post/23448">Cron pattern to copy over a USB drive</a>:</p>
<blockquote>
<p dir="auto">ok, now worked, I can use that path and my back-up was saved there.</p>
</blockquote>
<p dir="auto">Nicely Done!</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sky_watcher" aria-label="Profile: sky_watcher">@<bdi>sky_watcher</bdi></a> said in <a href="/post/23448">Cron pattern to copy over a USB drive</a>:</p>
<blockquote>
<p dir="auto">lso I have a question, this feature of writing directly the location of the USB drive into the Backup Directory works only in V3? In V2.8 is it working or not?</p>
</blockquote>
<p dir="auto">It'll work in both instances as long as your directory permissions are set correctly. Under the hood mango V2 and V3 are still running java, V3 just has a new shiny interface.</p>
]]></description><link>https://forum.mango-os.com/post/23449</link><guid isPermaLink="true">https://forum.mango-os.com/post/23449</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:38:33 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:34:41 GMT]]></title><description><![CDATA[<p dir="auto">ok, now worked, I can use that path and my back-up was saved there.</p>
<p dir="auto">Also I have a question, this feature of writing directly the location of the USB drive into the Backup Directory works only in V3? In V2.8 is it working or not?</p>
]]></description><link>https://forum.mango-os.com/post/23448</link><guid isPermaLink="true">https://forum.mango-os.com/post/23448</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:34:41 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:33:27 GMT]]></title><description><![CDATA[<p dir="auto">Perfect, try doing backups now with mango</p>
]]></description><link>https://forum.mango-os.com/post/23446</link><guid isPermaLink="true">https://forum.mango-os.com/post/23446</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:33:27 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:31:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: mattfox">@<bdi>mattfox</bdi></a></p>
<pre><code>mango@mangoES3324:/media/usb0$ls
file  lost+found
mango@mangoES3324:/media/usb0$touch newfile
mango@mangoES3324:/media/usb0$ls
file  lost+found  newfile
mango@mangoES3324:/media/usb0$ls -la
total 24
drwxr-xr-x  3 mango mango  4096 Aug 29 15:43 .
drwxr-xr-x 12 root  root   4096 Aug 29 11:45 ..
-rw-r--r--  1 root  root      0 Aug 29 15:22 file
drwx------  2 mango mango 16384 Aug 29 14:54 lost+found
-rw-r--r--  1 mango mango     0 Aug 29 15:43 newfile
</code></pre>
]]></description><link>https://forum.mango-os.com/post/23445</link><guid isPermaLink="true">https://forum.mango-os.com/post/23445</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:20:11 GMT]]></title><description><![CDATA[<p dir="auto">You're logged in as root, you need to be the mango user if you want to test effectively, also please use those code tags, it makes a lot easier to read.</p>
<p dir="auto">Edit: Thanks!<br />
Ok dir permissions look good. Try doing the touch newfile as mango, if you can do that, there should be no issues with mango creating files. I'll check my server for you soon if wanted to compare configs.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/23444</link><guid isPermaLink="true">https://forum.mango-os.com/post/23444</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:20:11 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:17:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: mattfox">@<bdi>mattfox</bdi></a> said in <a href="/post/23440">Cron pattern to copy over a USB drive</a>:</p>
<pre><code>total 24
drwxr-xr-x  3 mango mango  4096 Aug 29 14:54 .
drwxr-xr-x 12 root  root   4096 Aug 29 11:45 ..
drwx------  2 mango mango 16384 Aug 29 14:54 lost+found
root@mangoES3324:/media/usb0$touch file
root@mangoES3324:/media/usb0$la -ls
total 16
 0 -rw-r--r-- 1 root  root      0 Aug 29 15:22 file
16 drwx------ 2 mango mango 16384 Aug 29 14:54 lost+found
</code></pre>
]]></description><link>https://forum.mango-os.com/post/23442</link><guid isPermaLink="true">https://forum.mango-os.com/post/23442</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:09:50 GMT]]></title><description><![CDATA[<p dir="auto">Also ensure the mango user has at least read permissions to /media</p>
]]></description><link>https://forum.mango-os.com/post/23441</link><guid isPermaLink="true">https://forum.mango-os.com/post/23441</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:09:50 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 19:06:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi guys, just gonna give a suggestion, cd into /media/usb0/<br />
then do the chown again</p>
<pre><code>sudo chown mango:mango . -R
</code></pre>
<p dir="auto">then enter the</p>
<pre><code>ls -la
</code></pre>
<p dir="auto">That should give us all info for that directory to start. Skywatcher, assuming you are using putty if you highlight the text, you can then paste into here with code tags.</p>
<p dir="auto">You should be able to create a file just with <code>touch file</code><br />
no sudo required</p>
]]></description><link>https://forum.mango-os.com/post/23440</link><guid isPermaLink="true">https://forum.mango-os.com/post/23440</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 29 Aug 2019 19:06:05 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 18:47:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> I get same error in mango and the drive is formatted as ext4, is mounted and the mango user has wrights to write on the usb0 folder.</p>
<p dir="auto"><img src="https://camo.nodebb.org/a816f75230007e724cbae8bc3b144f0607808aed?url=https%3A%2F%2Fi.imgur.com%2FJ8mqlvM.jpg" alt="0_1567105280887_format_type.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/23439</link><guid isPermaLink="true">https://forum.mango-os.com/post/23439</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 18:47:09 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 18:11:35 GMT]]></title><description><![CDATA[<p dir="auto">It could be caused by the filesystem type not supporting Linux permissions. Perhaps you could reformat the drive to an ext3 or ext4 filesystem?</p>
]]></description><link>https://forum.mango-os.com/post/23438</link><guid isPermaLink="true">https://forum.mango-os.com/post/23438</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 29 Aug 2019 18:11:35 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:57:27 GMT]]></title><description><![CDATA[<p dir="auto">This is the command and the error:</p>
<p dir="auto"><img src="https://camo.nodebb.org/5502726054cf968f9a4c19a67f577137c0948453?url=https%3A%2F%2Fi.imgur.com%2FvFjniBx.jpg" alt="0_1567102304395_owner_error.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/23437</link><guid isPermaLink="true">https://forum.mango-os.com/post/23437</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:54:30 GMT]]></title><description><![CDATA[<p dir="auto">I edited the command, as there was no reason to give the mango user access to /media/boot/</p>
]]></description><link>https://forum.mango-os.com/post/23436</link><guid isPermaLink="true">https://forum.mango-os.com/post/23436</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:54:30 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:53:19 GMT]]></title><description><![CDATA[<p dir="auto">I wouldn't think so. Did you sudo? What response did you get from running the command?</p>
]]></description><link>https://forum.mango-os.com/post/23435</link><guid isPermaLink="true">https://forum.mango-os.com/post/23435</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:53:19 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:51:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> I don't have permission to change the owner for /media/usb0/. Could be a problem because the USB is mounted there?</p>
]]></description><link>https://forum.mango-os.com/post/23434</link><guid isPermaLink="true">https://forum.mango-os.com/post/23434</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:51:37 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:54:42 GMT]]></title><description><![CDATA[<p dir="auto">Try chown'ing that to the 'mango' user like,</p>
<p dir="auto"><code>sudo chown -R mango:mango /media/usb*</code></p>
]]></description><link>https://forum.mango-os.com/post/23433</link><guid isPermaLink="true">https://forum.mango-os.com/post/23433</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:54:42 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:47:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> On Mango I'm logged in with admin.</p>
<p dir="auto">The mounting point is owned by root.</p>
]]></description><link>https://forum.mango-os.com/post/23432</link><guid isPermaLink="true">https://forum.mango-os.com/post/23432</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:47:34 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:33:08 GMT]]></title><description><![CDATA[<p dir="auto">Did you see over SSH or Webmin if the device is actually mounted there? It could also be a permissions issue, if Mango is running as a non-root user but that mounting point is owned by root. Check with <code>ls -l /media/</code></p>
]]></description><link>https://forum.mango-os.com/post/23431</link><guid isPermaLink="true">https://forum.mango-os.com/post/23431</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:33:08 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Thu, 29 Aug 2019 17:30:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Hi Phil! Thanks for your advice.</p>
<p dir="auto">When I try to give that path to the backup directory I get an error:<br />
<img src="https://camo.nodebb.org/1cd5ff3ca9f125b7170fdfcca5a17d33a80932a8?url=https%3A%2F%2Fi.imgur.com%2F7wnYDQd.jpg" alt="0_1567100665637_backup_error.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/23430</link><guid isPermaLink="true">https://forum.mango-os.com/post/23430</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 29 Aug 2019 17:30:15 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Wed, 28 Aug 2019 18:26:57 GMT]]></title><description><![CDATA[<p dir="auto">True, it's applicable on any other Linux system - and you provided adequate notice that it's a bad place to make a mistake!</p>
]]></description><link>https://forum.mango-os.com/post/23415</link><guid isPermaLink="true">https://forum.mango-os.com/post/23415</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 28 Aug 2019 18:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Wed, 28 Aug 2019 18:26:13 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Phil!<br />
Wasn't entirely sure on if fstab was applicable but felt it was good enough to mention for how a linux fs works at least.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/23414</link><guid isPermaLink="true">https://forum.mango-os.com/post/23414</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 28 Aug 2019 18:26:13 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Wed, 28 Aug 2019 16:33:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi sky_watcher,</p>
<p dir="auto">You shouldn't have to worry about mounting the USB drive with fstab as Fox suggested - V3 Mango ES units have usbmount installed to facilitate the USB Utilities actions. It will mount the first USB stick plugged in at <code>/media/usb0</code></p>
<p dir="auto">After that, your choices are</p>
<ol>
<li>Set Mango to backup directly to the USB drive instead of to the /opt/mango/backup folder. This is in the system settings</li>
<li>Set up a cron pattern as Fox suggested and add that to a crontab either via <code>crontab -e</code> to invoke the script or simply add the script <code>/etc/cron.daily/</code> (and then you don't need to generate the cron pattern but you have less control).</li>
<li>Set a schedule in Mango and use event handlers to copy / move files as necessary.</li>
</ol>
]]></description><link>https://forum.mango-os.com/post/23408</link><guid isPermaLink="true">https://forum.mango-os.com/post/23408</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 28 Aug 2019 16:33:23 GMT</pubDate></item><item><title><![CDATA[Reply to Cron pattern to copy over a USB drive on Wed, 28 Aug 2019 07:56:25 GMT]]></title><description><![CDATA[<p dir="auto">Use rsync:<br />
<a href="https://linux.die.net/man/1/rsync" rel="nofollow ugc">https://linux.die.net/man/1/rsync</a><br />
Rsync can also delete the source files after they have been copied over if needed, however mango should do that for you if you've got a rolling backups of N days.<br />
Also take note you are better off making a bash script so you can run some checks. IE if the file system exists (the usb I mean)<br />
Make sure the bash script starts with</p>
<pre><code>#!/bin/bash
</code></pre>
<p dir="auto">Use <a href="https://crontab-generator.org/" rel="nofollow ugc">https://crontab-generator.org/</a> to generate the cron pattern you'd like to use.<br />
Finally:<br />
Look at fstab for automatically mounting the USB file system and giving it a friendly name under mount if applicable - not necessary though<br />
<a href="https://help.ubuntu.com/community/Fstab" rel="nofollow ugc">https://help.ubuntu.com/community/Fstab</a></p>
<p dir="auto">Read up on that first and make sure everything lines up before restarting the mango , it can throw a spanner in the works if Linux doesn't like the fstab configuration.</p>
<p dir="auto">Once you've had a read I can assist further</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/23393</link><guid isPermaLink="true">https://forum.mango-os.com/post/23393</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 28 Aug 2019 07:56:25 GMT</pubDate></item></channel></rss>