Bash Shell on Windows 10

Microsoft announced today that it’s bringing in Bash shell into Windows 10. Bash or Bourne Again Shell, is the standard shell terminal for both OS X and Linux terminals. That means developers will be able to write their shell scripts in Windows 10.

How is this possible. Microsoft worked with Canonical, Ubuntu flagship company, in getting a Linux subsystem inside Windows 10 without the need for virtualization or emulation.

The native availability of a full Ubuntu environment on Windows, without virtualization or emulation, is a milestone that defies convention and a gateway to fascinatingly unfamiliar territory,” Canonical founder Mark Shuttleworth said in a statement today. “In our journey to bring free software to the widest possible audience, this is not a moment we could have predicted. Nevertheless we are delighted to stand behind Ubuntu for Windows, committed to addressing the needs of Windows developers exploring Linux in this amazing new way, and excited at the possibilities heralded by this unexpected turn of events.

Does this mean no more of the dreaded backlash on paths?

Backup MySQL via Bash Script

If you run your own LAMP server, you might want to check out this Bash script which perform backups of the MySQL database. The neat little script can be set to run independently or as part of a cron job. All you have to do is provide the backup directory, username, password, hostname and port number.

The backup script is quite simple. It checks if the backup directory exists and creates one if it’s missing. It will then list all databases and performs a MySQL dump of each database ignoring the mysql, information_schema, and test databases. The file is formatted in gzip and then stored in the backup directory.

The backup script can be set to run every day or once a week using cron. The backup will depend on your backup requirements. I recommend testing the backup and restore process to see if it works.