|
|
In this second part of HTAULB we will be visiting the topic of how to automate MySQL database backups. Although I will be the first to admit this is completely simple and a very nice way of accomplishing this task, I will also advise that it is not the most secure. I would not recommend this to anyone sharing a server or its resources with other people. You will be hard coding your SQL password into a script and although you could restrict ‘Read’ permissions from anyone else seeing it, I will advise against it on any shared machine.
Now, on with the show!
If you haven’t read the first part of this series please go back and do so, I’ll wait….
Back? Took you long enough. I had you read that because we will be doing some of the same tasks in order to automate the SQL backups.
You will need to go to the location in which you are keeping your .sh scripts. (We use /bin here at IAmRoberson)
Use the editor of your choice to edit the file using the name of your choice for the script’s name:
Add the following line for each database you wish to make a sql dump from.
|
mysqldump -u username -h localhost -p(password) databasename | gzip -9 > /var/backups/nameoftargetfile-$(date +%Y%m%d).db.sql.gz
|
Exit from the editor and chmod the file to 766. (see previous post for exact syntax.)
Add an additional line in the crontab like you did for (part 1) of this exercise.
You are done! Go back up some stuff now!
- Jason
Did this article help you any? Please feel free to leave feedback.
I recently redesigned my home setup and wanted to automate my backups for my web servers and SQL server. I run Ubuntu 9.10 using a semi-typical LAMP configuration. For those of you unfamiliar with LAMP it is an acronym for Linux, Apache, MySQL, and PHP. Your first step is to determine what you want backed up. For me the /var/www and /etc/apache2 directories were my primary targets. After that you need to write a Shell script to tar/gz that directory and put it into a folder where you wish for your backups to reside. I will say the smartest thing to do is to eventually copy these files to a different location than the drive/box you’re backing up so a physical drive failure won’t take your backups with them and make this entire process moot. Sounds easy right? It is, and I’ll show you just how easy it really is.
After you’ve determined what you want backed up you need to write that shell script. Here is how to accomplish that:
From a command console on your Linux box, change to the directory you wish for your .sh script to reside. For example: /bin/
Fire up your CLI editor of choice and edit a file that will become your shell script. For me this is VIM so I would type the following:
Add the following lines, substituting my locations and file names with your own:
|
cd /var/backups/ tar -czf web_backup.$(date +%Y%m%d).tar.gz -C / var/www/ -C / etc/apache2/
|
The first line changes the directory to where you will drop the backup file. I know you can do this several ways but this way you can see each step of what is being accomplished.
The second line creates a tar.gz named web_backup(today’s date).tar.gz from the /var/www and /etc/apache2 directories.
Exit and save your script.
You will need to change the permissions on the file in order to run it so type the following: (again subbing ‘script_name’ with your scripts name)
You can type the script name and it should execute. Once this has been tested and you see that a tar.gz is created in the directory you’ve specified you can move to the next step, which is to automate it with Cron.
==========
Everything work? Hope so, because we’re moving on regardless.
Next you’ll want to add this script to your crontab.
Type crontab -l to get a list of all jobs listed in your crontab. Don’t worry if it says something about one not existing, You probably don’t have one set up yet.
Type crontab -e to edit the file.
There is a great write up that Kevin van Zonneveld did at : http://kevin.vanzonneveld.net that explains how the crontab scheduling works. I’ll give you a quick review but I recommend heading over there and checking his site out to learn more.
The crontab is set up very simply. The first part of the line is a series of numbers to regulate the schedule part and the second part is the execution you would like Cron to perform at those increments.
The default syntax is : * * * * * /blah/blah.sh
The 5 * each stand for something. They are (respectively) minute | hour | day of month * (every day of month) | of month * (every month)| weekday (0-6 Sunday being 0)
So in order to perform the task desired for example every Friday at 0100 (am) you would use:
| 30 1 * * 5 /bin/backup_script.sh |
Clear as mud right? You get it, I know you do. Again, go see Kevin’s site for more explanation and tips/tricks.
You could schedule it for a few minutes ahead of the current time and wait to see if it works correctly before you start depending on it.
Next post will be how to automate SQL database backups with mysqldump and Cron.
Till next time, Peace Out Yo.
- Jason
I’m not sure what got me thinking about it but all of a sudden I’d gotten a wild hair to look at new bikes. Maybe it’s been a couple random great weather days or the bikes I’ve seen on those days but I’ve gotten my spring bike fever and have been itching to ride. After looking around a bit I settled on a bike that fit what I needed in power, comfort, and design as well as what I wanted in look and aesthetics. The bike I became fascinated with in my search is the 2009 Ninja 650R.
My first bike and the one I am migrating from is a Kawasaki ZR-7S. I love this bike. Kawasaki did a good job and designing the ZR with power and comfort but it was time for me to step up to something a little more modern. The 650R comes with digital display, fuel injection, a clock (you don’t understand how valuable this can be), and a little more zip to it even with a listed 100cc less between your legs.
Here are pictures of my bikes, both the 2001 ZR-7S and the 2009 Ninja 650R respectively.

Although the perspectives are a little skewed with the pictures you may be able to tell that the ZR7 is a little bigger. The dry weight on the Ninja is listed as 40lbs lighter than the ZR7 and although it feels a lot lighter than that, I’m thinking a lot of the weight difference (in how it feels) is due to a lower center of gravity as well as the fact that I’ve gotten use to wrestling with the weight and possibly have strengthened a few muscles in the couple of years I was maneuvering the ZR7.
One thing I do notice immediately is the lack of comfort. The comfort of the Ninja is not lacking however I already miss my Corbin seat. Riding a steel pony for longer than 45 minutes can leave your derrière a little or a LOT fatigued. Unfortunately the Corbin seat for the 650R is about $450.00 and is not high on my list of affordable upgrades. One upgrade that is on my list to buy soon is a set of ‘Grab Bars’ for the back. The need for grab bars isn’t so much for a passenger but for strapping things to the back. The stock Ninja does not come with the grab bars like it’s sister the ER-6n. I still have not figured this one out. Anyone from Kawasaki care to chime in?
I will need to sell the ZR7 soon, I don’t really want to continue to pay for a bike I don’t ride…. Anyone interested?
Well, we’ve reached 2010. Much to the sorrow of many fiction writers of the past, there are no flying cars, light-speed space ships, hover boards, or time travel devices… That we know of. What we DO have in 2010, is an economy that retrospectively fits our ‘Great Depression’, a Democrat in office who apparently prays to Karl Marx, 2 wars being fought overseas (with bullets not lasers, mind you), and a bunch of crazy ice/snow/freeze temperatures throughout the world. So much for Global Warming right Mr. Gore?
New years eve went off rather well. I didn’t spend my evening at work working on a production issue like last year so I’m guessing maybe all of 2010 will turn out better. Visited with some friends, cracked the dust off of my German, and got to forget about life for a while.
Resolutions? Well there’s a couple I made to myself this year. One of them is to lose a few pounds. Yeah I know, the same as 75% of America but oh well, this one is for me. I don’t need to go on some silly crash diet or anything, I just need to watch my calorie intake a little and control my portions. I think if I cut out most or all of my soda intake I can lose the lbs. I need to without much extra effort. I do however need to exercise my dog more so maybe some extra walking around the block will be good for both of us.
- Jason
I’d say that the title was a joke initially but in all reality it pretty much boils down to that. Insurance ([to avoid] Death) and the Obama sodomy squad looking to take as much from people as they can (Taxes). I’ve tried time and time again to give this guy the benefit of the doubt but he’s not really leaving me many options at this point. The current healthcare legislation is getting to a point to which I cannot hold my tongue any longer. Obama and his cronies, wanting to help, are trying to give everyone in America healthcare. While I can respect the notion I cannot however respect his approach. For those of you who are not paying close enough attention, here is what they are trying to push through and why it should tick you off:
I.
A Public Option: – Government run healthcare.
For those of you unfamiliar with this concept look at our current government run programs for seniors or veterans. In fact, try talking to anyone that is using either of these options more than for checkups. Some would say that the Federal government has yet to successfully run a program like this on a smaller scale much less what they are proposing now. I personally would like to add that whether they CAN do it or not… they shouldn’t. It’s not their job nor duty as a Government. It puts their paws too far into the business infrastructure of the country. This is how and why the government keeps growing to its ungodly and unnecessary size and stealing more and more power to control individuals. The federal government should do very few things. Examples of these few things are: 1) Protect our outlying borders from foreign enemies. 2) Regulate State to State interests and relationships. 3) Hrm, still trying to figure out a number 3.
II.
Taxes:
Staying with the Democrat status quo, the Obama administration is looking to take the normal approach of having the rich pay for the poor. I am all for charities but I am a firm believer in working for what you have. I understand that there are people out there that work harder than I do for next to nothing and those are the people I actually DO want to find a way to help however, there has got to be a better way. There are WAY TOO MANY people out there currently ‘mooching’ off of the system and making the current system worse than it really should be. There are people who NEED government assistance to get by yet cannot get it. These people work 40+ hours a week and only need a tiny bit of help to get over the hump while some people sit at home collecting welfare checks refusing to even LOOK for a job. There are people that keep popping out children even though they couldn’t/can’t afford the first one, two, or three that they had. I won’t even get started on DRUG TESTS for WELFARE CHECKS because GOD knows we could save A LOT of money if that were enacted.
Basically if the current bill passes, the more money you make, the more money they take and I don’t mean on a 1 to 1 ratio. Different income brackets will pay outrageously more in taxes and for health insurance than lower income brackets… FOR THE SAME COVERAGE! No doubt those of us that choose to keep our own private insurance will still pay taxes to cover others. For example: Its currently being said that someone with the income base of 60,000 or so will pay somewhere between 20-30% of their income towards insurance. OMFG! Really? Lets see now, If I make 60k a year then I will pay 15-18k a year for insurance? And I guarantee it will be coverage only moderate in quality for what I currently pay 5k a year for now. If you make more, you will be held MORE responsible for paying for other’s insurance.
III.
Forced:
Once this is in, everyone will be FORCED by law to have health insurance. No joke. Unconstitutional anyone? I do see the reasoning behind it though as a patriot I could never justify it. If everyone is paying through the nose for insurance yet ‘Paco’ (for example) decides that he still doesn’t want to buy it because he can still get taken care of and skip out on the bill, then why not just do that? I think this part of the bill means well to protect the rest of us but is way too unconstitutional to actually do. Apparently the OSS (Obama Sodomy Squad) still thinks they can do this and is trying to with this bill. You will be forced to either have private insurance (which I believe will disappear eventually) or the government plan. Sounds to me like the ONLY reason the private insurance realm is starting to back this bill.
The OSS swears up and down that you will be able to keep your current insurance if you wish and they will not force you to take the NEW plan but it doesn’t take a genius to figure out their end game on this one either. All companies still offering privatized insurance to their employees will get taxed and penalized insanely to recover costs for their employees not taking the ObamaCare plan. As a small company or even a business savvy one which would you choose? 1) Continue to get screwed out of thousands or millions of dollars to ‘do the right thing’ by your employees and offer good insurance plans… or 2) Save money to avoid going broke and give in to the pressure. Offering the ObamaCare packages to their employees may be the only thing to do. Seems to me that slowly but surely the back alley politics behind this will eventually force everyone to the ObamaCare package whether they want it or not.
IV.
If its so good…
If the new plan is so great with so many coverage options and benefits…. If it’s going to save money yet still give you the ‘best quality treatment’…. If this is what will save so many American’s lives…. then WHY ARE SENATORS, CONGRESSMENT, THE PRESIDENT, HIS FAMILY, AND ANYONE ACTUALLY VOTING THIS THROUGH… EXEMPT FROM HAVING TO TAKE THIS OPTION? Oh think about how much these ass-hats would have to pay based on THEIR salaries.. (See Taxes:) This is for real yet no one is answering this question. I’d say let them pass the damned bill but only IF everyone in the aforementioned groups HAS to take the plan as government employees. Nah, it would never even make it through one voting session if that were the case.
I will try to shred through the 2000+ page bill to cite specifics like I usually do but as of now… chew on the ugly fat that I’ve given you. At this point I’m all for advising everyone of you to write/call your representatives and telling them that if they vote ‘yes’ then you’ll vote against them next election no matter who is running against them. These people work for us but they seem to forget that. I will go out on a limb and say that there hasn’t been an uprising against the government this large since the Vietnam war and they don’t seem to take notice. All we can do is speak out and that’s what a lot of people are doing. Maybe we just need more people to do it.
What do you think?
- Jason
Kingdom Hearts: 358/2 Days
By: Joe Murphy
Overview: Kingdom Hearts 358/2 Days is the sequel to the first two Kingdom Hearts games. It is not card based like Kingdom Hearts Chain of Memories, it is an action RPG meaning that you can move around while attacking, using magic,etc. It begins with Roxas (who is the “nobody” of the first main character Sora) who is starting his job with the group known as XIII. A “nobody” is a being made from a person with a heart and is born when the person with the heart is in a very long sleeping state. Roxas is trying to help the other twelve members of XIII try to defeat the heartless and restore the Kingdom Hearts so him and his companions can have their own hearts and also maybe figure out who the mysterious number XIV member of XIII is. You will run into a very extensive cast of Disney characters along the way some good and some evil. A few of them will be Mickey, Donald Duck, Hercules and Aladdin as the good guys and Pete (from goof troop), Hades, and Ursula. Characters like Mickey and Donald will be aiding Roxas in his journey while characters such as Pete will be trying to hinder him from defeating the heartless.
Features: The game has a lot of really great features that are similar to its console cousins. The battle system is again real time like its predecessors, which means you can move around while attacking and healing and stuff. Although you do all your commands with the A button you will need to scroll through the list of action like Attack, Magic, and Items with the X button. This game also features an all new panel system that lets you store your items like potions, ethers and items for teaching you magic on you to use on the fly instead of having to reach for your bag. You also pick up all sorts of items along the way from treasure chests and from destroying enemies. These items can include: restoration items such as potions or ethers for restoring magic, weapons since Roxas wields a variety of key blades, health and experience points.
Review: Kingdom Hearts 358/2 Days is a good game all around. It feels and plays just like the other favorites on the PS2. It’s also great because there hasn’t been an action RPG Kingdom Hearts game in a very long time and it still lives up to the hype. The controls are good, the story is phenomenal, and the characters are amazing as always. The only thing negative I have to say about it is that the story line is mission based. I’m not a huge fan of the mission based game play although I do understand why they did this. In the original Kingdom Hearts and Kingdom Hearts 2 you had to walk around the large towns and cities to find people to tell you information or clues as to where to go and what to do and you fought enemies along the way. In this game you do missions and report back to your superior when you are done. They did this because of the group XIII in the game they are like a secret military group and send their soldiers on missions to defeat the heartless and restore the Kingdom Hearts. Although still fun, the missions got a little stale and boring after a while I thought. Overall, I still think this game is great and can be enjoyed by any age children to adult. I would give this game a 8 out of 10.
Over the duration of the last year, IAmRoberson has hit several milestones. This last week two more milestones have been reached.
The first milestone is that we’ve reached over 3000 visits. I am happy with the progression this site has taken. I’ve done little to promote it and lately have done very little in adding to it. (Sorry for that) Hopefully that will be remedied soon as I will try to update more frequently. I’ve been spending a lot of time working on the Photography website as well as the photography itself.
The second milestone is IAmRoberson has gained another writer. (For as long as they are interested) Throughout the years I’ve had different sites and on those sites I attempted to be a ‘Jack of all Trades’. One of the things I attempted on every site was writing reviews. Reviews of Games, Movies, Music… I’ve tried it all. This is difficult to do and a lot of work for one person to keep up with. This time I decided to use my failed experiences of the past and to use my resources a bit. I’ve got a friend that works in the gaming industry so to speak and he would be definitely a better resource for reviewing games. So without further ado… I would like to welcome Joe Murphy to the site. I personally want to call him ‘Gamer Joe’ on here but not sure if he wants to use his real name or not.
Hope you enjoy his work and effort. Please comment and let us know what you all think.
- Jason
I find myself saying it more and more lately… The more I dislike all of the Socialism the current President and his administration are trying to infuse into our current Economy, the more I also realize that I like the president himself. Last night’s Letterman makes a perfect example of why… Recently former POTUS Jimmy Carter made the jackass comment that the outburst/s made against the current Administration’s Healthcare bill is due to racism. C’mon, can’t someone that once qualified as the most powerful man in the world do something better than jump on a cheesy bandwagon? Everyone that disagrees with Obama’s changes are being called racist. I would expect this from Sharpton or Jackson but Carter!?!?!?! Really? Well the POTUS himself last night debunked Carter saying… "I think it’s important to realize that I was actually black before the election." People voted for him because they liked him. Some didn’t because they didn’t. I didn’t because his policies scared me and all in all… they still do but as a person… I think he’s gotta be pretty cool to hang out with.
For the love of God I hope his Healthcare bill gets blown apart or changed drastically. I disagree with his solutions for several other issues but I would still love to have the invite to a ‘Beer Summit’ with him. The man has a sense of humor and that’s what I appreciate most in people. In today’s society everyone gets too whiny and ‘sue happy’ if someone doesn’t agree with them or isn’t PC enough. I’ve watched Obama deflect a lot of criticism with much style instead of getting his presidential boxers in a bunch. Hooray to you President Obama.
I have been formulating my public approach to this healthcare bill and proposal and will be posting that very soon… I just thought I would put up these Kudos…
- Jason
I took the opportunity last weekend to help out a friend and expand my portfolio. Senior portraits are insanely expensive and I decided to take some photos of a friend’s daughter to help give her options in order to save some money on the packages. You can read more about it over at Dragon Lens Photo. Here are a couple shots, let me know what you think. And be sure to check the other site as it has more samples.


- Jason
My sister recently asked if I could do her a favor and photograph an event for her. The pay would be “eats and drinks” but it would save from someone that was supposed to be enjoying the event from having to run around and try to catch everything. I happily agreed knowing that I could use the experience and exposure.
I knew ahead of time that the location was going to be tricky. It was at a higher scaled bar/restaurant which means the lighting would be low. For anyone that has ever attempted ‘real’ or even ‘point and shoot’ photography knows that this is a nightmare if you aren’t prepared. Well… I was prepared mentally of what the challenge would be but was not prepared with the equipment (external flash) or the experience of making it work it’s magic. I had a friend of mine loan me his flash (430ex) the day of the even and I had absolutely no time to adjust to it. Flash photography is an entirely different animal than standard photography.
Well, the event came and went. I am now looking through the mess of photos and I am happy with a few but over all I am disappointed. Of course I am my own worse critic and my sister or anyone else that looks at them will not notice a thing. This is still not good enough. I will put them through several layers of PP and see what I can come out with.
Crude. I spent most of the evening trying to bounce the light off of different walls and ceilings. Some angles were too bright, some too dark, others cast terrible shadows. It was very hectic trying to learn (event) flash photography on the fly. The people weren’t in the mood to pose much. During the awards ceremony people just wanted to run up there, snag their award and scurry off. I guess I should have been more direct. Me? The picture Nazi? Nah! I’ll have to do it at some point though, right?
Either way, the even was fun. I got to meet some new people, including a really great music artist. You can find him at www.jamiecarrollmusic.com. Unfortunately he doesn’t live local so I won’t get to frequent many of his shows but if you are in any of the areas that he plays (check his site calendar) you really should check him out. Outside of the music he seems to be a really nice guy. I really enjoyed chatting with him off to the side throughout the night.
Who knows, maybe I’ll get some ‘work’ out of all of this…
- Jason

|
|