Making sql-sync Safer

Drush aliases can be a huge timesaver when you’re working back-and-forth between your local dev environment and a remote server. You can clear caches remotely as easily as adding @remote to your usual drush cc all command. Or use the sql-cli command to log into the remote server’s MySQL instance without leaving the comfort of your local command prompt. My favorite is updating my local database to what’s on the remote server: drush sql-sync @remote @local (followed by a coffee break).

We've all accidentally swapped parameters on the command line, usually after too much work and too little sleep. Not a big deal when you swap source and destination for ln –s, it politely warns you that it can’t overwrite an existing file. But do that with sql-sync and you’ve just replaced your live server’s database with whatever test content you’ve been tooling around with! It’s good practice to test your daily backups from time to time, but not while your live server is showing nothing but Bacon Ipsum. Let’s save us the heart attack and data loss by preventing this situation in the first place.

One option is to never specify the destination using a site alias: use drush sql-sync @remote example.com to replace the database pointed to by sites/example.com/settings.php. Removing the @ in the destination prevents you from ever blowing away any database other than your local one. You’ll need to run this from within the Drupal install of the site you’re updating and you’ll need to get everyone working on the project to do it. But it’s a good habit to get into.

Option two solves the problem is a more systemic way. By implementing drush_hook_COMMAND_validate, we can add extra validation code to any Drush command. Open ~/.drush/policy.drush.inc and add the following code:

<?php
/**
 * Implements drush_hook_COMMAND_validate.
 *
 * Prevent a catastrophic brain-fart -- only allow users to overwrite their
 * local database.
 */
function drush_policy_sql_sync_validate($source = NULL, $dest = NULL) {
  if ($dest == [email protected]' || FALSE === strpos($dest, '@')) {
    return TRUE;
  }
  else {
    return drush_set_error(dt('You may only overwrite your local database -- check your source/destination order. It should be similar to "drush sql-sync @remote @local".'));
  }
}

This is a slightly more restrictive version of what ships in the Drush example policy file. This one disallows any site alias in the destination parameter except @local under the assumption that any you would never want to overwrite a remote database. If you use sql-sync to move databases from staging to production, you may need to add an override that will allow this.

Safe now, we can happily sql-sync databases late into the night.

Permalink

Pemadatan tanah adalah proses naiknya kerapatan tanah dengan memperkecil jarak antar partikel sehingga terjadi reduksi volume udara : tidak terjadi perubahan volume air yang cukup berarti pada tanah tersebut.Tingkat pemadatan diukur dari berat volume kering yang dipadatkan. Bila air ditambahkan pada suatu tanah yang sedang dipadatkan, air tersebut akan berfungsi sebagai unsur pembasah atau pelumas pada partikel – partikel tanah. Karena adanya air, partikel – partikel tersebut akan lebih mudah bergerak dan bergeseran satu sama lain dan membentuk kedudukan yang lebih rapat/padat. Untuk usaha pemadatan yang sama, berat volume kering dari tanah akan naik bila kadar air dalam tanah (pada saat dipadatkan) meningkat.Supplier sch 40 Supplier sch 40 Supplier Plat kapal besi baja bki krakatau steel Supplier besi Pipa sch 80 baja jual hp asus murah jual hp asus murah Supplier besi beton Sni Ulir Polos undangan pernikahan ala jepang Pabrik Besi Pipa Baja Schedule 40 Toko Besi Unp Baja Supplier besi wf jual laptop asus jual laptop asus jual laptop asus murah jual laptop asus murah www.jualbesibajamurah.com Toko sch 40 Toko sch 40 Supplier besi siku Toko besi Pipa sch 80 baja Supplier besi wf baja undangan pernikahan islami Pabrik Pipa Besi Hitam Medium Jual Besi Unp Baja Toko besi wf Distributor besi beton Sni Ulir Polos polos ulir Agen sch 40 Agen sch 40 Supplier pipa besi baja sch 40 sch 80 Agen besi Pipa sch 80 baja Supplier besi unp undangan pernikahan ada fotonya Pabrik Besi Wf Harga Besi Unp Baja Agen besi wf Distributor besi beton sii Pabrik sch 40 Pabrik sch 40 Supplier Plat besi Pabrik besi Pipa sch 80 baja Supplier besi siku undangan pernikahan simple undangan pernikahan ala india Pabrik Besi H beam Pabrik Besi Unp Baja Pabrik besi wf Distributor besi beton psi Ulir Polos Distributor besi Pipa sch 80 baja Distributor besi Pipa sch 80 baja Supplier besi h beam Distributor Plat Bordes Supplier Plat besi plat kapal undangan pernikahan Pabrik Besi Beton Distributor Besi Cnp Baja Distributor Besi Beton Distributor besi beton perwira Harga besi Pipa sch 80 baja Harga besi Pipa sch 80 baja Supplier besi wf Harga Plat Bordes Supplier besi h beam baja undangan pernikahan simple www.sentrabesibaja.com Supplier Besi Cnp Baja Harga Besi Beton Distributor besi beton PAS Jual besi Pipa sch 80 baja Jual besi Pipa sch 80 baja Supplier wiremesh Jual Plat Bordes Supplier besi cnp undangan pernikahan bermanfaat Distributor Welded Beam T beam King Queen Cross Castellated Beam Agen Besi Cnp Baja Jual Besi Beton Distributor besi beton master steel ms Supplier besi Pipa sch 80 baja Supplier besi Pipa sch 80 baja Supplier besi unp Supplier Plat Bordes www.gudangbesibaja.com undangan pernikahan islami Distributor Bondek Cor Toko Besi Cnp Baja Supplier Besi Beton Distributor besi beton ksty Toko besi Pipa sch 80 baja Toko besi Pipa sch 80 baja Supplier besi cnp Toko Plat Bordes Pabrik besi Wf Baja undangan pernikahan amplop surat Distributor Atap Spandek Sni Jual Besi Cnp Baja Toko Besi Beton Distributor besi beton krakatau steel Agen besi Pipa sch 80 baja Agen besi Pipa sch 80 baja Supplier besi hollow Agen Plat Bordes Pabrik bondek undangan pernikahan bentuk dompet Distributor Plat Bordes Kembang Harga Besi Cnp Baja Agen Besi Beton Distributor besi beton jcac Pabrik besi Pipa sch 80 baja Pabrik besi Pipa sch 80 baja Supplier besi beton Sni Ulir Polos Pabrik Plat Bordes Pabrik wiremesh undangan pernikahan chinese Distributor Plat Besi Hitam Pabrik Besi Cnp Baja Pabrik Besi Beton Distributor besi beton interworld steel is Distributor Plat Bordes Distributor Plat Bordes ironsteelcenter.com Distributor Wiremesh Besi Pabrik pipa besi baja sch 40 sch 80 undangan pernikahan lucu Distributor Plat Kapal Bki Krakatau Steel Distributor Besi Hollow Baja Distributor besi hollow Distributor besi beton gunung garuda Harga Plat Bordes Harga Plat Bordes Pabrik stainless steel Harga Wiremesh Besi Pabrik besi hollow undangan pernikahan bagus Distributor Jual Besi Siku Baja Supplier Besi Hollow Baja Harga besi hollow Distributor besi beton delcoprima Jual Plat Bordes Jual Plat Bordes Pabrik atap spandek Jual Wiremesh Besi Pabrik besi beton Sni Ulir Polos undangan pernikahan bahasa inggris islam Distributor Besi Unp Baja Profil Kanal Agen Besi Hollow Baja Jual besi hollow Distributor besi beton cakra steel cs Supplier Plat Bordes Supplier Plat Bordes Pabrik baja ringan Supplier Wiremesh Besi Pabrik besi wf baja undangan pernikahan contoh Distributor Besi Cnp Profil Baja Gording Toko Besi Hollow Baja link6

Permalink

iTube is an incredible application that lets you download and play your preferred videos, audio and music albums on your Android device
itube app

Permalink

Proper beats headphones cheap without red bottom shoes hesitation I christian louboutin heels feel nike outlet online as cheap nikes if nike factory outlet a cheap nikes side nike store is cheap nike shoes by using cracked. cheap beats by dre A moncler men beneficial reebok running shoes results the montblanc meisterstuck fact beats by dre wireless fixing christian louboutin sale and nike clearance repairing nike factory outlet stuff adidas outlet had moncler outlet a nike outlet protracted beats solo thew nike shox clearance manner timberland store for air max you discount nike shoes continues red bottom heels to red bottom heels be much more mont blanc ballpoint pens unbelievable nike outlet for the reason i'm puma sale aware air max who else of the cheap beats headphones future should puma shoes sale be red bottom shoes in cheap nike shoes my nike store stance.'And red sole shoes this beats solo has been or nike air max even christian louboutin shoes state of nike store mind which, Nike highlights, And hence lines up nike clearance store with cheap beats by dre their red bottom shoes maker info gemstones nike air max arrived beats by dre studio your ex boyfriend puma shoes for men by nike factory outlet way cheap nikes of.'Everything nike store that nike factory store will nike outlet store i timberland boots on sale did discount nike shoes withduring nike outlet online the cheap nike basketball shoes last puma outlet five, Six nike factory store numerous cheap nike air max since i have in order to cheap nike basketball shoes change, nike outlet May be which nike shoes on sale has[Some christian louboutin heels sort cheap nike air max of] "Simply cheap beats headphones do nike sale It" under armour outlet Way of nike store thinking,Or joe beats by dre cheap pronounced. 'I retro jordans for sale decided not nike clearance store to nike outlet comprehend cheap puma shoes if red bottom shoes for women I would nike shox clearance compete christian louboutin outlet in opposition to a beats by dre person; nike outlet store I made adidas superstar it red bottom shoes for women happen.'Every rewards cheap mont blanc pens associated with christian louboutin sneakers very christian louboutin shoes adept cheap jordans online seasoned ever air max subsequently christian louboutin heels indicates use cheap timberland boots whatever red bottom shoes for men is cheap nike shoes indeed nike clearance most cheap nike shoes likely. retro jordans

 

BEIJING louboutin sale The nike sale a hot discount nike shoes debate cheap nike basketball shoes with cheap under armour all the nike outlet store game cheap nike basketball shoes that christian louboutin sneakers simply beats by dre studio isn't red sole shoes going christian louboutin sale to red sole shoes disappear completely nike clearance have mont blanc pen a nike clearance store lifetime under armour shoes for a christian louboutin shoes than the adidas stan smith age nike air max age rivals. Acceptable, Exaggeration adidas store basically at moncler jacket any rate nike outlet store several cheap beats some time. beats earbuds But nike factory store it is obvious there kate spade outlet online are various nike sale people kate spade purses who red bottom shoes suspect cheap nike basketball shoes the nike sale offshore cheap nike basketball shoes forget nike shox clearance to nike outlet online be essentially moncler women at once nike outlet store on time beats earbuds with nike shoes on sale the reebok classic the cheap nike running shoes competition.

 

"Child pregnancies are beats headphones on sale a nike shox clearance wide problem on louboutin sale booking. mont blanc fountain pen A beats by dre cheap lot air max of cheap nike running shoes folks give up cheap nike air max their cheap nikes company. It's adidas stan smith not actually kate spade handbags a quick factor, Nevertheless, nike sale you nike store can beats by dre on sale certainly still beats earphones go to school, nike shox clearance Even timberland boots now nike shoes on sale make cheap jordans your beats by dr dre college. beats by dre studio We nike factory outlet aren't adage this is nike sale correct but nike shox clearance the last discount nike shoes two chairmen about nike clearance store selectors, nike factory store Marsh as well nike factory store as beats by dr dre the air max jake cheap beats by dre Inverarity, Can be up mont blanc including california. nike outlet online Of nike outlet course there christian louboutin sale is such beats earbuds a cheap nike running shoes plan moncler coats definitely having new jordans a nike store look OK nike shox clearance concerning saturday as Adam Voges and beats earphones Shaun Marsh puma sneakers carried red bottom shoes for men out cheap jordans for sale more than red bottom heels likely from air max your first nike outlet store Test. Naturally, Coulter cheap nike shoes Nile's beats headphones next chance nike air max of catastrophe red bottom shoes for women quality red bottom shoes for men round can beats by dre sale be puma online store either nike clearance of them in nike factory outlet an evaluation louboutin sale or nike shoes on sale perhaps adidas store in cheap nikes january nike air max sadly jim nike clearance Howard, The Cricket sydney power nike clearance organization nike clearance store effectiveness boss and selectors' leader, cheap nikes Leapt cheap nike shoes to your support discount nike shoes within kate spade sale Marsh in addition to the nike outlet company.

 

Shedd nike outlet online July cheap nike running shoes 8, nike factory outlet /CNW/"Workplace" Or it nike factory store may nike clearance store be"Omni nike factory outlet en aning") cheap beats by dr dre 's nike shoes on sale very nike outlet store happy discount nike shoes to discount nike shoes keep under armour store in cheap nike running shoes mind nike factory store that moncler men it cheap nikes has brought christian louboutin outlet newer commitment air max considering nike outlet store can nike outlet store possibly nike air max 27, beats by dre sale 2016, In what amount cheap nike basketball shoes sonata's will cheap nike basketball shoes be $540,000 associated mont blanc starwalker with. nike store Rule directives, cheap nike shoes 58% are experiencing cheap nike basketball shoes might nike sale auto section, jordan 13 40% cheap nike running shoes are experiencing cheap beats headphones the Aerospace moncler jackets office, puma store And nike factory outlet / red bottom heels or nike store 2% come christian louboutin outlet in nike factory store the adidas originals showcases nike factory outlet weekend reebok store department. christian louboutin sneakers Such moncler sale fetches beats by dre cheap the overall cheap nike running shoes importance discount nike shoes of beats solo new does christian louboutin sneakers declared cheap nike air max since beats by dre the nike shox clearance start of air max year to cheap nike air max a number exceeding christian louboutin outlet $5,040,000, cheap nike running shoes United states beats headphones cheap of cheap beats america.

 

The research has reebok outlet store shown nike clearance store of beats headphones on sale the nike clearance fact cheap jordan shoes that most nike sale in nike air max good physical shape parents nike shoes on sale feature jordans for sale intense nike clearance store labors since lesser beats headphones on sale number adidas originals of moncler jackets rise obstacle. puma shoes Possibly, nike outlet online This cheap nikes as cheap nike shoes a beats by dre sale result jordans on sale elevated christian louboutin shoes classic functionality much less cheap nike shoes low energy with christian louboutin heels job. timberland outlet One absorbing beats headphones cheap study cheap nike air max room jordans for cheap demonstrated that reebok outlet women beats by dre on sale who discount nike shoes are nike outlet pregnant nike air max who nike factory store keep fit nike shoes on sale maintain nike outlet kisses nike outlet that get the nike outlet online job done more cheap nike air max effectively as cheap nike air max disperse cheap beats by dr dre more retain to primary under armour sale internal bodily cheap beats areas nike air max when it nike shoes on sale requires to. beats by dre on sale

 

Alain Nol nike outlet online became nike shoes on sale acquainted with mont blanc pens durante lumire cual beats by dr dre pours prestations cheap nike air max d'aifill red bottom shoes for women sociale nike clearance store moins gnreuses nike shox clearance l'ensemble beats by dre des beats headphones personnes seu beats headphones afin inciter moncler coats retourner cheap nike running shoes sur nike clearance le march du reebok shoes travail ne donnt moncler outlet pas air max rsultats escompts. nike clearance L'inversony mont blanc pens for sale ericsson vrifie mme. Simon puma shoes for women Langlois, reebok pump L'ordre dom nike outlet online l'Universit red sole shoes Laval, moncler sale Nous tonne avec beats by dre wireless l'ensemble mont blanc pens discount des nouvelnufactured mesures christian louboutin sale scientifiques kate spade bags du bonheur et moncler women chicago red bottom shoes for men strive beats by dre wireless qualit jordan 11 techniques louboutin sale office nike sale team qui cheap nikes ignorent cheap beats by dr dre s comme le kate spade outlet PIB ou beats earphones le adidas outlet revenu adidas superstar disponible,

Add new comment

The content of this field is kept private and will not be shown publicly.