13
The Power of Unix Scripts for Joomla! René Kreijveld

The power of unix scripts for Joomla!

Embed Size (px)

DESCRIPTION

Simple and easy to user Unix scripts for your Joomla! environment

Citation preview

Page 1: The power of unix scripts for Joomla!

The  Power  of  Unix  Scripts  for  Joomla!  

René  Kreijveld  

Page 2: The power of unix scripts for Joomla!

Wie  kent  het  nog?  De  Windows  Command  prompt  

Page 3: The power of unix scripts for Joomla!

De  meeste  Joomla!  websites  zijn  gehost  op  Unix/Linux  servers.  

•  Naast  al  het  mooie  grafisch  geweld  van  GUI’s  beschikt  Unix  over  een  krachOge  command  prompt:  de  shell  

•  De  command  prompt  komt  beschikbaar  door  het  starten  van  een  Terminal  of  ssh  sessie  

•  Windows  batchfiles  =  Unix  shell  scripts  

Page 4: The power of unix scripts for Joomla!

Een  shell  starten  

•  Mac  OSX:  terminal  of  iTerm  hVp://iterm.sourceforge.net/    

•  Windows:  puVy  hVp://www.chiark.greenend.org.uk/~sgtatham/puVy/download.html    

Page 5: The power of unix scripts for Joomla!

Enkele  basiscommando’s  cd  pwd  

whoami  ls  

man  mkdir  rmdir  cat    

Page 6: The power of unix scripts for Joomla!

Let  op  bij  het  werken  in  de  shell!  

•  Veel  commando’s  vragen  niet  om  een  bevesOging,  maar  voeren  direct  de  gevraagde  acOe  uit!  

•  BACKUP  –  BACKUP  –  BACKUP    zorg  alOjd  voor  een  goede  backup  

•  Voorbeeld:  rm  commando  

Page 7: The power of unix scripts for Joomla!

Uitvoer  aan  Invoer  koppelen  

•  Uitvoer  van  een  commando  kan  doorgestuurd  worden  naar  invoer  volgende  commando  

•  Uitvoer  koppelen  met  het  ‘pipe’  symbool:  |  •  Voorbeelden:  ls  -­‐l  |  more  cat  configuraOon.php  |  grep  password  

Page 8: The power of unix scripts for Joomla!

Hoe  kan  Unix  die  commando’s  vinden?  

•  Unix  zoekt  in  het  ‘zoekpad’  naar  uitvoerbare  commando’s  

•  Het  zoekpad  ligt  vast  in  de  environment  variabele  ‘PATH’  

•  Het  zoekpad  is  op  te  vragen  met:  env  |  grep  PATH  

•  In  te  stellen  in  je  .profile  (autoexec.bat)  

Page 9: The power of unix scripts for Joomla!

Commando’s  combineren:  scripts  

•  Wat  batchfiles  zijn  voor  Windows,  zijn  shell  scripts  voor  Unix  

•  Plaats  de  scripts  in  een  directory  die  in  het  zoekpad  zit  

•  Maak  scripts  uitvoerbaar  door  ze  ‘executable’  te  maken:  chmod  +x  scriptnaam  

•  Of,  in  FTP  termen:  rwxr-­‐xr-­‐x  

Page 10: The power of unix scripts for Joomla!

Voorbeeld  script:  setowner  

Page 11: The power of unix scripts for Joomla!

Command-­‐line  argumenten  

Page 12: The power of unix scripts for Joomla!

Complexere  scripts  •  joomlainfo  Geef  informaOe  over  je  Joomla!  website  

•  jdbdump  Maakt  een  database  dump  

•  jbackup  Maakt  een  full  backup  

•  jfindfiles  Zoekt  ongebruikte  bestanden  

Page 13: The power of unix scripts for Joomla!

Bronnen:  

h"p://www.jsnippets.net/snippets/bash    

hVp://www.shelldorado.com  hVp://www.ooblick.com/text/sh/