Forums / General / File storage synchronization

File storage synchronization

Author Message

Gene Surov

Wednesday 14 October 2009 1:18:42 am

Hi,

my problem is the following: we have 2 servers: production server with Ubuntu 8.10 and development server - virtual machine with similar configuration.

I've created a simple script which synchronizes the DB (you can find it at the end of my post).

My current problem is to synchronize the uploaded files storage. I've found some mentions of cluster mode in ez publish which puts all the files (storage and cache), but I can't switch my production into this mode. Another possibility is to set up rsync, but it requires some efforts and this approach is not flexible enough. Had anyone had the same problem? Any suggestions?

!/bin/sh

date=`date +%Y%m%d%H%M%S`
filename=../sql/$date."bz2"

ssh sysuser@10.10.41.74 \
"mysqldump -udbuser -pdbpass -hproduction_db_server db_name | bzip2 -cz" \
> $filename

cd ../sql
bunzip2 $filename
mv $date db.sql

mysql -udev_db_user -pdev_db_pass dev_db < db.sql

Gaetano Giunta

Wednesday 14 October 2009 2:42:26 am

Since you already have a script for moving over the db, why not add in there 2 lines to copy over the zipped storage folder, too?

Other notes:
- add a call to ezcache.php to clean all caches after reimporting db+storage
- you might also add a call to eztc to recompile all templates (cache warmup)
- why not do a dump of the updated db (and associated storage) before overwriting it? just in case...

Of course if the copy is from prod to dev and not the other way round, the above steps can be done manually on the dev server by the developer itself...

Principal Consultant International Business
Member of the Community Project Board

Rose McMarry

Tuesday 27 October 2009 2:47:53 pm

I use a program to file synchronization, which is called File Sync. [URL="http://www.fileutilityblog.com/archives/188"]File Sync: why you need it?[/URL] May be because of its efficiency. That is why I use this program and haven't any problems. Did you use it?

eZ debug

Timing: Jan 18 2025 18:38:39
Script start
Timing: Jan 18 2025 18:38:39
Module start 'content'
Timing: Jan 18 2025 18:38:39
Module end 'content'
Timing: Jan 18 2025 18:38:39
Script end

Main resources:

Total runtime0.2737 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0100 587.7031180.8438
Module start 'content' 0.01010.0124 768.546993.8359
Module end 'content' 0.02240.2512 862.3828523.2734
Script end 0.2736  1,385.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00451.6504200.0002
Check MTime0.00190.7000200.0001
Mysql Total
Database connection0.00291.058410.0029
Mysqli_queries0.165760.52621410.0012
Looping result0.00200.74561390.0000
Template Total0.250691.510.2506
Template load0.00100.381310.0010
Template processing0.249591.157910.2495
Override
Cache load0.00080.282010.0008
Sytem overhead
Fetch class attribute can translate value0.00070.243310.0007
XML
Image XML parsing0.00040.134710.0004
General
dbfile0.01174.2895200.0006
String conversion0.00000.001830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs