<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Backup &#8211; BeatificaBytes</title>
	<atom:link href="https://www.BeatificaBytes.be/tag/backup/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.BeatificaBytes.be</link>
	<description>The Joys of Computing</description>
	<lastBuildDate>Sun, 12 Aug 2018 10:15:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>
	<item>
		<title>How to backup Photo from a mobile onto a Synology</title>
		<link>https://www.BeatificaBytes.be/how-to-backup-photo-from-a-mobile-onto-a-synology/</link>
					<comments>https://www.BeatificaBytes.be/how-to-backup-photo-from-a-mobile-onto-a-synology/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 12 Aug 2018 10:15:47 +0000</pubDate>
				<category><![CDATA[Synology]]></category>
		<category><![CDATA[Backup]]></category>
		<guid isPermaLink="false">http://www.BeatificaBytes.be/?p=3850</guid>

					<description><![CDATA[I used to rely on DS Cloud to backup my complete Android mobile onto my Synology (both internal and external storage). But after Android 4.4.x, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify">I used to rely on DS Cloud to backup my complete Android mobile onto my Synology (both internal and external storage). But after Android 4.4.x, the files must be stored under /storage/&lt;your external sd&gt;/Andoid/data/com.synology.dsclooud/files. It means DS Cloud may not backup the DCIM folder locate on the external SD.</p>
<p style="text-align: justify">The solution is to get rid of DS cloud and use DS File or DS Photo &#8211; or a third party, but this a less preferred option for me&#8230;</p>
<p style="text-align: justify"><span class="collapseomatic " id="id69b2d3678ecc5"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2d3678ecc5'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2d3678ecc5" class="collapseomatic_content ">
<h1 style="text-align: justify">DS Photo</h1>
<p style="text-align: justify">It has a feature to backup all photos from a mobile (Android or iOS) into one folder/album of the Photo Station. But it means that Photo Station must be installed.</p>
<p style="text-align: justify">See documentation <a href="https://www.synology.com/en-global/knowledgebase/Mobile/help/DSphoto/Android" target="_blank" rel="noopener">here</a> (loo for <strong>Upload and Download Photos</strong>).</p>
<p style="text-align: justify">It&#8217;s really slow because it needs to create the thumbnails, etc&#8230; for Photo Station and seems even to stop from time to time. You have to open it to check that it runs effectively.</p>
<p style="text-align: justify">Pay attention to not check the option that frees space. It will deleted the photos on your mobile after the upload.</p>
<p>NB.: It also backup movies (&#8220;<em>You can upload photos or videos from &#8230;</em>&#8220;), but does not seem to do it as long as all photos are not yet uploaded. Many old videos were not yet uploaded onto my Synology although photos with the same age were already processed. And after the backup of 1000th of photos, I finally saw a long list of videos being uploaded.</p>
<p><span style="color: #000000;font-weight: bold;text-align: justify">DS File</span></p>
<p style="text-align: justify">It has a feature to backup all photos and videos into any subfolder of a shared drive. As far as I am concerned, I do backup into a subfolder of my &#8220;home&#8221; on the Synology.</p>
<p style="text-align: justify">See documentation <a href="https://www.synology.com/en-global/knowledgebase/Mobile/help/DSfile" target="_blank" rel="noopener">here</a> (look for <strong>Backing up Photos and Videos</strong>).</p>
<p style="text-align: justify">Pay attention to not check the option that frees space. It will deleted the photos and movies on your mobile after the backup.</p>
<p style="text-align: justify">DS File can backup photos and videos from all detected locations containing media: DCIM (external storage), Office Lens, PhotosEditor, WhatsApp Images, WhatsApp Video. But you may not specify yourself a custom folder. It&#8217;s nevertheless the best option to backup all media in my opinion.</p>
<p>Attention, I noticed that DS File consumed a lot of power during the first backup, so it was suggested to be put in deep sleep mode. But doing that stops the backup background process. Compared to DS Photo, it&#8217;s quite exactly the same behavior and configuration but one can chose the target folder on the Synology. Also, it is much faster (as it does not have to create anything for the Photo Station) and backup all videos and photos simultaneously.</p>
<p><strong>Moment</strong></p>
<p>There is now a new application, named Synology Moment, which also comes with a Backup feature for photos and videos, similar to Photo Station. I didn&#8217;t test it yet.</p>
<p>(Synology Moment is combined with Synology Drive, an application replacing Cloud Station Server)</p>
<p style="text-align: justify"></div>
<div class="pvc_clear"></div>
<p id="pvc_stats_3850" class="pvc_stats total_only  " data-element-id="3850" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p>
<div class="pvc_clear"></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/how-to-backup-photo-from-a-mobile-onto-a-synology/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Synology Cloud Station and Cloud Sync are slow</title>
		<link>https://www.BeatificaBytes.be/synology-cloud-station-and-cloud-sync-are-slow/</link>
					<comments>https://www.BeatificaBytes.be/synology-cloud-station-and-cloud-sync-are-slow/#comments</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 22 Oct 2017 19:05:37 +0000</pubDate>
				<category><![CDATA[Synology]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Cloud Station]]></category>
		<category><![CDATA[Cloud Sync]]></category>
		<guid isPermaLink="false">http://www.BeatificaBytes.be/wordpress/?p=3127</guid>

					<description><![CDATA[I was wondering why Cloud Station Backup and Cloud Sync were so slow on my NAS. It appeared that it was &#8220;normal&#8221; for Cloud Sync, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify">I was wondering why <a href="https://www.synology.com/en-global/knowledgebase/DSM/help/CloudStation/cloudstation" target="_blank" rel="noopener">Cloud Station Backup</a> and <a href="https://www.synology.com/en-global/knowledgebase/DSM/help/CloudSync/cloudsync" target="_blank" rel="noopener">Cloud Sync</a> were so slow on my NAS. It appeared that it was &#8220;normal&#8221; for Cloud Sync, but could be improved for Cloud Station Backup, especially on my LAN, by using my NAS&#8217; local IP instead of the &#8220;QuickConnect&#8221; feature.</p>
<p style="text-align: justify"><span class="collapseomatic " id="id69b2d36790601"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2d36790601'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2d36790601" class="collapseomatic_content ">
<p style="text-align: justify"><span style="text-decoration: underline"><strong>Cloud Station</strong></span></p>
<p style="text-align: justify">I found <a href="http://jhein.net/2014/07/23/synology-cloud-station-extremely-slow/" target="_blank" rel="noopener">here</a> that using &#8220;QuickConnect&#8221; with Cloud Station, the traffic was routed through Synology’s servers, making it incredibly slow. In my LAN, it really accelerated as soon as I replaced QuickConnect by the local IP of my NAS or with a domain address resolved by my local DNS.</p>
<p style="text-align: justify"><span style="text-decoration: underline"><strong>Cloud Sync</strong></span></p>
<p style="text-align: justify">I found <a href="https://www.dropboxforum.com/t5/Syncing-and-uploads/Sync-speed-is-slow-Synology-NAS-Cloud-Sync/td-p/58731" target="_blank" rel="noopener">here</a> the reason why Cloud Sync was slower than native Sync applications. The answer given by Synology is:</p>
<div class="section" style="text-align: justify">
<div class="callout">
<p>Could Sync is performing sync, it is heavy process, please see below detailed information from help:Why is Cloud Sync slower than other cloud services&#8217; PC applications?</p>
<p>Due to the below limitations, Cloud Sync might take longer to sync files with public cloud services than the official PC applications such as Dropbox and Baidu.</p>
<p>&nbsp;</p>
<ul>
<li><strong>Speed limits imposed by cloud service providers</strong>: Although no public cloud service provider has disclosed any information related to this topic, it is highly possible that public cloud servers communicate with their official PC applications through a dedicated tunnel/protocol, or impose bandwidth limitations on third-party applications that access their services on a regular basis (such as Cloud Sync).</li>
<li><strong>No incremental update</strong>: Some cloud service providers do not releases a public API for developers to track file changes. This means Cloud Sync must re-download and sync the entire file every time a file has been modified, even when you&#8217;ve only made partial modifications. On the other hand, cloud service providers&#8217; official PC applications might be able to re-download and sync the modified bits only, reducing sync time.</li>
<li><strong>No local network sync</strong>: Certain public cloud service providers offer LAN sync, a technique that allows one client to obtain files from existing clients in the same local area network (LAN), thus significantly boosting sync speed. However, LAN sync accesses files in client computers without notifying them, which could possibly become a security backdoor. Therefore, this feature is not included in Cloud Sync.</li>
</ul>
<p>Given the above limitations, the syncing performance of Cloud Sync shall continue to be enhanced, while also maintaining the safety and security of your Synology NAS.</p>
<p>DS currently does not control the sync speed, and does not have function to enhance it.</p>
<p>However, we will continue to try improve our service and product.</p>
</div>
</div>
<p style="text-align: justify"></div>
<div class="pvc_clear"></div>
<p id="pvc_stats_3127" class="pvc_stats total_only  " data-element-id="3127" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p>
<div class="pvc_clear"></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/synology-cloud-station-and-cloud-sync-are-slow/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Schedule a Backup of all your MySQL databases on Synology</title>
		<link>https://www.BeatificaBytes.be/schedule-a-backup-of-all-your-mysql-databases-on-synology/</link>
					<comments>https://www.BeatificaBytes.be/schedule-a-backup-of-all-your-mysql-databases-on-synology/#comments</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sat, 29 Sep 2012 20:26:08 +0000</pubDate>
				<category><![CDATA[Synology]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[DS209+]]></category>
		<category><![CDATA[MySQL]]></category>
		<guid isPermaLink="false">/wordpress/?p=127</guid>

					<description><![CDATA[It would be a good idea to schedule a daily backup of all the MySQL databases on your Synology. Those will indeed be wiped out [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">It would be a good idea to schedule a daily backup of all the MySQL databases on your Synology. Those will indeed be wiped out if by accident, you have to reset your NAS (reinstall the firmware), ex.: if you lose a disk in your RAID 0.</p>
<p style="text-align: justify;">That can be done using a shell script and a cron job as described here after.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2d36792f49"  tabindex="0" title="How to Backup"    >How to Backup</span><span id='swap-id69b2d36792f49'  class='colomat-swap' style='display:none;'>Click to close</span><div id="target-id69b2d36792f49" class="collapseomatic_content ">
First, create a user with a local-read-only access on the databases. We will indeed have to let its password in the script, endangering the security. Using a local-read-only user will mitigate the risks.</p>
<ol style="text-align: justify;">
<li>Go to the web administration interface (DSM) of your NAS.</li>
<li>Install phpMYAdmin via the &#8220;Package Center&#8221; if not yet done.</li>
<li>Open phpMyAdmin via the &#8220;Start Menu&#8221; (&#8220;Main Menu&#8221;).
<ol>
<li>I am using the login &#8216;root&#8217; with the password of Syno&#8217;s &#8216;admin&#8217; user</li>
</ol>
</li>
<li>Open the &#8220;Users&#8221; tab in phpMyAdmin</li>
<li>Click &#8220;Add User&#8221; (bellow the list of existing users)</li>
<li>Enter the User Name. Ex.: backup</li>
<li>Select “localhost” as an Host.</li>
<li>Enter a password. Ex.: mysql</li>
<li>Keep “none” as “Database for user”</li>
<li>Grant the user with Global privileges: Select (in Data) and Reload, Show Databases and Lock Tables (in Administration)</li>
<li>Click “Add User” at the botton of the page</li>
</ol>
<p style="text-align: justify;">Next, create a shell scripts in a Shared Folder of the NAS (Ex.: \volume1\backup\backupMySql.sh). Working in a Shared Folder will make it easier for you to copy/open later the backups from your PC). Don&#8217;t forget to create a &#8220;Unix&#8221; file, either using the touch command in a Console or saving a file As a &#8220;Unix shell script&#8221; within Notepad++. Notice that a script created with NotePad++ and saved on the Shared Folder will belong to the user account accessing that Shared Folder (Most probably your Windows Account if like me you simply created a user on your NAS with the same login and password). A script created with &#8220;touch&#8221; in a Console will belong to the user accessing the NAS via telnet/SSH (Most probably the &#8220;root&#8221; account).</p>
<pre>[shell]#!/bin/sh
#
DIR=/volume1/backup/sqlbackup/
DATESTAMP=$(date +%Y%m%d%H%M%S)
DB_USER=backup
DB_PASS=mysql

# create backup dir if it does not exist
mkdir -p ${DIR}

# remove backups older than $DAYS_KEEP
#DAYS_KEEP=30
#find ${DIR}* -mtime +$DAYS_KEEP -exec rm -f {} \; 2&gt; /dev/null

# remove all backups except the $KEEP latest
KEEP=5
BACKUPS=`find ${DIR} -name 'mysqldump-*.gz' | wc -l | sed 's/\ //g'`
while [ $BACKUPS -ge $KEEP ]
do
  ls -tr1 ${DIR}mysqldump-*.gz | head -n 1 | xargs rm -f
  BACKUPS=`expr $BACKUPS - 1`
done

#
# create backups securely
#umask 006

# dump all the databases in a gzip file
FILENAME=${DIR}mysqldump-${DATESTAMP}.gz
/usr/syno/mysql/bin/mysqldump --user=$DB_USER --password=$DB_PASS --opt --all-databases --flush-logs | gzip &gt;&gt; $FILENAME
[/shell]
</pre>
<p style="text-align: justify;">NB: Since DSM 6.0, “/usr/syno/mysql/bin/mysqldump” has been moved to “/bin/mysqldump” !!!</p>
<p style="text-align: justify;">Possibly, type the following command in a Console (telnet/SSH) to set the user &#8216;root&#8217; as owner of the script:</p>
<pre>[shell]chown root /volume1/backup/backupMySql.sh[/shell]</pre>
<p style="text-align: justify;">IMPORTANT notice: I used to have &#8220;-u DB_USER&#8221; (with a blank space in between) in my script above and -&#8220;p$DB_USER&#8221; (without a blank) instead of &#8211;user and &#8211;password. But a reader (Fredy) reported that the script was not running fine for him unless removing the blank. As per documentation of mysqldump&#8217;s <a title="SqlDump User Param" href="http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_user" target="_blank" rel="noopener noreferrer">user parameter</a> and <a title="SqlDump Password Param" href="http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_user" target="_blank" rel="noopener noreferrer">password parameter</a>, there should be a blank after -u but not after -p. However, samples on the web usually illustrate the use of mysqldump with &#8220;-uroot&#8221;. So, I decided to use the more explicit notation &#8220;&#8211;user=&#8221; and &#8220;&#8211;password=&#8221;. I did test this notation with a wrong username or password and the resulting dump is indeed empty. With the correct username and password, it works fine.</p>
<p style="text-align: justify;">Since DSM 4.2, the Task Scheduler can be used to run the script on a daily basis.</p>
<ol style="text-align: justify;">
<li>Go to the Start Menu</li>
<li>Open the Control Panel</li>
<li>In the &#8220;Application Settings&#8221;, open the Task Scheduler</li>
<li>Select &#8220;Create a User-Defined Script&#8221;</li>
<li>Type a name for that &#8220;Task:&#8221;</li>
<li>Keep the &#8220;User:&#8221; root</li>
<li>In the &#8220;Run Command&#8221; pane, type:
<pre>sh /volume1/backup/backupMySql.sh</pre>
</li>
</ol>
<p style="text-align: justify;">Don&#8217;t forget the &#8220;sh&#8221; in front of your command, otherwise, it does not work (although the sample provided by Synology is missing it ?!)</p>
<p style="text-align: justify;">If you don&#8217;t use the Task Scheduler, you can add a Cron Job to execute the script, e.g. every day at 0:01. Open a Console (Telnet/SSH) and type:</p>
<pre>[shell]echo "1       0       *       *       *       root    sh /volume1/backup/backupMySql.sh" &gt;&gt; /etc/crontab[/shell]</pre>
<p style="text-align: justify;">FYI, a cron line syntax is &#8220;mm hh dd MMM DDD user task&#8221; where:</p>
<ul style="text-align: justify;">
<li>mm is the minute (0..59)</li>
<li>hh is the hour (0..23)</li>
<li>dd is the day in the month (1..31)</li>
<li>MMM is the month (jan, feb, &#8230; or 1..12)</li>
<li>DDD is the day in the week (sun, mon, &#8230; or 0..7 where 0 and 7 beeing both sunday)</li>
</ul>
<p style="text-align: justify;">The following values can also be used:</p>
<ul style="text-align: justify;">
<li>* : a every unit (0, 1, 2, 3, 4&#8230;)</li>
<li>5,8 : at unit 5 et 8</li>
<li>2-5 : units 2 to 5 (2, 3, 4, 5)</li>
<li>*/3 : every 3 units (0, 3, 6, 9&#8230;)</li>
<li>10-20/3 : every 3 units, from 10th to 20th (10, 13, 16, 19)</li>
</ul>
<p style="text-align: justify;">So, the script will start every day at 0:01h</p>
<p style="text-align: justify;">Finally, you must restart the cron daemon to activate the new job. To find the process id and send a SIGHUP signal to this one, type the following command line in a Console (Telnet/SSH):</p>
<pre>[shell]ps | grep crond | grep -v grep | awk '{print$1}' | xargs -t kill -HUP[/shell]</pre>
<p style="text-align: justify;">It should display &#8220;Kill -HUP xxxx&#8221; where xxx is the pid of the cron daemon.<br />
</div>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2d36792fec"  tabindex="0" title="Added on 03/01/2013"    >Added on 03/01/2013</span><span id='swap-id69b2d36792fec'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2d36792fec" class="collapseomatic_content ">
<p style="text-align: justify;"><span style="text-decoration: underline;">Attention</span>: if you copy paste the command to restart the cron daemon from this page into the telnet console, some symbols will be wiped out: the ‘{ and ‘ around print$1… you have to type them manually…</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">Attention</span>: if you upgrade the version of DSM, the changes made in the cron script are lost (at least, it&#8217;s what I have noticed after updating last month&#8230;). Reason why I recommend to use the new &#8220;Task Scheduler&#8221; feature available since DSM 4.2.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">Tip to edit the cron script</span>: you can use the package &#8220;Config File Editor&#8221; available <a title="Config File Editor for Synology" href="http://www.mertymade.com/syno/#cfe" target="_blank" rel="noopener noreferrer">here</a>. Once installed, you can access it via the Main Menu. Then, you have to edit the file named &#8220;Config File Editor&#8221; and add the following line:</p>
<p style="padding-left: 30px; text-align: justify;"><code>/etc/crontab,crontab</code></p>
<p style="text-align: justify;">Once this line is added and saved, &#8230; I don&#8217;t remember how to force the change to be taken into account :/. But restarting the DiskStation is enough <img src="https://s.w.org/images/core/emoji/15.1.0/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p style="text-align: justify;">Finally, back into the Config File Editor, select the &#8216;crontab&#8217; entry and modify this script, save your changes and restart the cron daemon.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">Tip to restart the cron daemon</span>: you can use the package &#8220;MODS Web Console&#8221; available <a title="Wec Console for Synology" href="https://www.beatificabytes.be/sspks/?arch=all#" target="_blank" rel="noopener noreferrer">here</a>. To install it, go to the Package Center and add the following url via the Settings &gt; Package Sources : <a href="https://www.beatificabytes.be/sspks" target="_blank" rel="noopener noreferrer">https://www.beatificabytes.be/sspks</a>. Once this url added, go to the tab &#8220;Community&#8221; and click Install on the &#8220;MODS Web Console&#8221; icon.</p>
<p style="text-align: justify;">Run the Web Console via the Main Menu, log in with &#8220;admin&#8221;/&#8221;admin&#8221; (The defaults values if not changed) and type:</p>
<p style="padding-left: 30px; text-align: justify;"><code>synoservice --restart crond</code></p>
<p style="text-align: justify;"></div>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2d36793051"  tabindex="0" title="Added on 01/12/2013"    >Added on 01/12/2013</span><span id='swap-id69b2d36793051'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2d36793051" class="collapseomatic_content ">
<p style="text-align: justify;">If you want a lazy solution to notify the Administrator about the success or failure of the backup, you can use the &#8216;synonotify&#8217; command (See <a title="Use Synology Notifications" href="https://www.beatificabytes.be/send-custom-email-notifications-from-scripts-running-on-a-synology/" target="_blank" rel="noopener noreferrer">details here</a>). A more advanced solution would be to configure the &#8220;Mail Server&#8221; and use its &#8216;sendmail&#8217; command:  /volume1/@appstore/MailServer/sbin/sendmail&#8230;</p>
<p style="text-align: justify;"></div>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2d367930b1"  tabindex="0" title="Added on 08/01/2017"    >Added on 08/01/2017</span><span id='swap-id69b2d367930b1'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2d367930b1" class="collapseomatic_content ">
<p>mysqldump has moved</p>
<ul>
<li>DSM 6.0 : /usr/syno/mysql/bin/mysqldump</li>
<li>MariaDB 5: /volume1/@appstore/MariaDB/usr/bin/mysqldump<br />
MariaDB 10: /volume1/@appstore/MariaDB10/usr/local/mariadb10/bin/mysqldump</li>
<li style="text-align: justify;"></div></li>
</ul>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2d3679310d"  tabindex="0" title="How to Restore"    >How to Restore</span><span id='swap-id69b2d3679310d'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2d3679310d" class="collapseomatic_content ">
<p style="text-align: justify;">To do a full restore, simply:</p>
<ol style="text-align: justify;">
<li>Copy the archive (.gz) you plan to restore on your local PC</li>
<li>Go to &#8220;phpyMyAdmin&#8221; &gt; &#8220;Import&#8221; &gt; &#8220;Chose File&#8221; (next to <em>Browse your computer</em>).</li>
<li>Select the .gz file to be restored</li>
<li>Press &#8220;Go&#8221; at the bottom of the page (no need to change any settings)</li>
</ol>
<p style="text-align: justify;">Pay attention: this is a complete restore, I.e.: all databases are dropped and recreated from scratch.</p>
<p style="text-align: justify;">If you want to be able to restore a subset of your databases you better have to change the script to backup specific databases instead of &#8211;all-database.</p>
<p style="text-align: justify;">If you want to restore only one table &#8216;mytable&#8217; from the backup &#8216;<em>mysqldump-datetime.gz&#8217;</em>:</p>
<ol style="text-align: justify;">
<li>Unzip first the archive: gunzip <em>mysqldump-datetime.gz</em></li>
<li>Then extract the part that restore the desired table with this command: sed -n -e &#8216;/DROP TABLE.*<em>mytable</em>/,/UNLOCK TABLES;/p&#8217; <em>mysqldump-datetime</em> &gt; <em>mytabledump</em></li>
</ol>
<p style="text-align: justify;"></div>
<p>Download the script <a href="http://valery.letroye.be/BeatificaBytes/backupMySql.sh" target="_blank" rel="noopener noreferrer">here</a>.</p>
<div class="pvc_clear"></div>
<p id="pvc_stats_127" class="pvc_stats total_only  " data-element-id="127" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p>
<div class="pvc_clear"></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/schedule-a-backup-of-all-your-mysql-databases-on-synology/feed/</wfw:commentRss>
			<slash:comments>56</slash:comments>
		
		
			</item>
	</channel>
</rss>
