rsnapshot: Auto Version Controlled Backup for Unix/Linux/Mac/BSD…

Red Had Enterprise Linux (RHEL) 6. I missed the ease of configuration and all the free tools that people smarter than me have created.

[fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”]

Systems that can take advantage of Rsnapshot

Systems that can take advantage of Rsnapshot

I would like to do a fast post on rsnapshot. I have seen ssh and rsnapshot scheduled in cron to automate backups of OSX to a Linux server. Since we didn’t want the wireless to slow down we only used the physical MAC address of the MAC. What makes rsnapshot so great is that it will wok on so many systems that are out there (Ubuntu, Debian GNU/Linux, Red Hat Linux, Fedora Linux, SuSE Linux, Gentoo Linux, Slackware Linux, FreeBSD, OpenBSD, NetBSD, Solaris, Mac OS X, and even IRIX) .

For now I’m using it for personal automated backups to my external hard drive. There are plenty of other advanced options and examples on the Internet. I just wanted to get out a fast an easy example.

  1. First – find and install rsnapshot. for Red Hat this was
    $ sudo yum install rsnapshot
    (rsynch is a dependancy that should already be installed).
  2. After install if you do not have this file /etc/rsnapshot.conf. Use the command:
    $ sudo cp /etc/rsnapshot.conf.default /etc/rsnapshot.conf
  3. Edit rsnapshot.conf – The defaults I changed from the default configuration file are below. These options allow me to back up everything in /etc/ and /home/. Backups kept will be twice a day, 7 days a week, 4 weeks, 12 months and 5 years (change this as you see fit).  Most important is that switch to make sure that the mount point will not be created and wrote to locally if the disk is not attached.
    1. WHERE TO PLACE BACKUPS
      # All snapshots will be stored under this root directory.
      #
      snapshot_root   /media/myexternal/rsnapshot/
    2. DO NOT CREATE IF DISK IS NOT CREATED
      # If no_create_root is enabled, rsnapshot will not automatically create the
      # snapshot_root directory. This is particularly useful if you are backing
      # up to removable media, such as a FireWire or USB drive.
      #
      no_create_root 1
    3. INTERVALS (make sure this is tabbed – do NOT use spaces)
      #########################################
      #           BACKUP INTERVALS            #
      # Must be unique and in ascending order #
      # i.e. hourly, daily, weekly, etc.      #
      #########################################
      interval        hourly  12
      interval        daily   7
      interval        weekly  4
      interval        monthly 12
      interval        yearly  5
       
  4. Time to configure cron. Most people will tell you to create your jobs using $ crontab e
    I prefer to use the root crontab using $ sudo vim /etc/crontab shown below:

    0 */12 * * * root /usr/bin/rsnapshot hourly # Every 12 hours
    30 23 * * * toot /usr/bin/rsnapshot daily   # Daily at 11:30PM
    20 2 * * 0 root /usr/bin/rsnapshot weekly   # Sunday at 2:20AM
    10 5 1 * * root /usr/bin/rsnapshot monthly  # First day of the month at 5:10AM
    01 8 1 1 * root /usr/bin/rsnapshot yearly   # January 1st at 8:01AM
     
  5. Test It – Following these steps you should have the basic setup needed to run rsnapshot on your personal computer to an external hard drive or usb. Just one last thing to do. Make sure that your hard drive is plugged in and  run:
    $ sudo rsnapshot -V hourly
    rsnapshot should give you plenty of verbose information as it creates your first hourly backup inside the location you specified. If there is a issue with the lock file, remove the lock file and try again.

Still stuck?

There are many other helpful documents out there  start with the rsnapshot how to:
http://www.rsnapshot.org/howto/1.2/rsnapshot-HOWTO.en.html#installation

If you want to learn how to do remote backup and use OSX? try this article:
http://blog.philippmetzler.com/?p=138

As I said in the beginning of this article, this was a fastpost and not meant to cove everything about rsnapshot. It took longer to write this article than it did to set up rsnapshot.
Good Luck – Adam M. Erickson

 

 [/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Expect – For more remote work, automation, & CI

If you ever have a situation were you want to run scripts automatically this will help.
You can even time the events through cron or CI (continual integration) software like Hudson/Jenkins.
Let me introduce you to a new command I was not aware of until this year.

It is called Expect.expect

Expect can be installed like any other package in a Linux environment.

  • $ sudo yum install expect
  • $ sudo apt-get install expect

Here is an example of what created inside Jenkins to run after a build as an shell script.

Instead of #!/usr/bin/bash

Use:hudson

#!/usr/bin/expect
set prompt "$ "
spawn ssh -t user@remote.server
set timeout 30
expect {
timeout {
puts "Connection timed out"
exit 1
}
"yes/no" {
send "yes\r"
exp_continue
}
"assword:" {
send -- "job00ibm\r"
exp_continue
}
"$prompt" {
send "cd ~/test/\r"
}
}

Now, as long as you have Internet, the correct username, remote server, and password. You should of just created a script the will SSH into a remote server and accept the RSA fingerprint. Or you just created a script that tells you the connection timed out.
Don’t alter this part of the script much because you want to be able to re-use and if there is not a yes/no at the prompt it will continue to expect assword:.
You can get change the last command to anything you want. I added that part because you remotes into a server for no reason?

Add this to the script and it will send the command to find anything with a certain name in it to be removed from the current directory.
expect {
"$prompt" {
send "find . -name '*filename*' -type f -print0 |xargs -0 rm -f\r"
}
}

Add this to the script to find files of a certain name and copy to a new location. You should be able to use modified times in the find switch if that helps.
expect {
"$prompt" {
send "find . -name 'coke*' -type f | xargs -n1 -i cp {} /data02/home/ibmcorp/12180-us-mcrtest1/upload/\r"
}
}

Add this to the script to run a script in the current directory.
expect {
"$prompt" {
send ". name.sh\r"
}

Does your script prompt for anything? Expect can enter the reply for you.
}
expect {
"the expected promt" {
send -- "the reply\r"
}
}

Some things need to e escaped like these ampersands. It is not way to find out what all needs to be escaped but you can figure that through trial and error, intuition, or because of how smart you are.
expect {
":" {
send "me\@a-erickson.com\r"
}
}

That’s my real address if you want to reach me.

All done running your script? Don’t forget to exit your connection.
expect {
"$ " {
send "exit\r"
}
}remote

  Have fun work remotely 🙂

Going Back to School

      This post informs of academic progression at college and the steps necessary to start, graduate and move on to a better job.

 Price of College Increases Every Year

Before you can take any classes you really have to decide if you are in it for the long haul. If you can’t afford the high rates of tuition plus unexpected charges, you should look into applying for financial aid, scholarships, and loans.

Technology has increased several folds since the 90’s, so has the way a college can educate its students. Because of the availability of alternative classes available to students that already have careers and/or families and are finding it easier to finish colleges.

In preparing this report I have spoken with financial counselors, academic counselors, and other students on what needs to be done in order to achieve your degree of choice as easy as possible. I already hold three associate degrees in Networking, Programming and Computer Applications, a bachelors in Computer Science and a Masters in Information Systems Management. I worked full time through all of these degrees, while raising 4 children.

 What Do You want to be doing 5-10 Years after College

 better jobsBefore you start taking classes you need to get a better understanding of what you like. Many people enter into fields of study just to change later on. There are several places online and at college campuses that will help guide you on the best career choice for you. Once you now what you want to do you can use that career choice to decide what type of education and diploma is necessary to pursue your future goals.

 The best place to start is always at the beginning. Before going back to college you should now what you want to do after college. Don’t chase dollar signs, it is best of you have a calling, a true desire to be in the field you choose and then pursuing a degree that will support this decision. Wither you have past experience or not.

 Extended Learning

 libraryThe nationwide availability of college programs gives busy working adults the opportunity to stay current in there chosen field and gives the additional education needed to advance in their career.

Available classes range from professional certificates to associate, bachelors, masters and doctoral degrees. Classes are offered in a variety of formats including evening and weekend classroom instruction, interactive television, mixed classroom instruction and online delivery as well as completely online instructions.

Were to get Help

https://bigfuture.collegeboard.org/college-search

The above address offers a list of classes by cities, selecting a city at or near your location will link to a page that will display programs available in that area. Make sure to call the student service office to verify if the program you are interested in is going to be available in the future. While pursuing a BS in Computer Information Systems (which is no longer available in my hometown), there was not a high demand and the satellite classes were moved to the closes major city area and I ended up having to drive 50 miles one way to class at night 2-3 times each week to complete my degree (WORTH IT).

Before you register you might want to know how close the nearest satellite campus is were you want to take classes and what they offer.

College counselors are usually available at least once a semester to help plan a course schedule. Find out when and make sure to schedule an appointment in advance.

 Preparing Your Finances

pile of moneyThere are numerous financial aid programs for students who need financial assistance. Programs are offered under federal, state, and institutions. Most people in middle class homes or lower income usually meet most requirements. Federal loans are also offered to supplement income or tuition while going to college.

I believe that you have to gamble a little in life and I rather bet on myself than a two dollar lottery ticket. That is why I have applied for the federal subsidized

loans to help pay for expenses while I go to college. I believe that I will be able to acquire a better paying career faster with a BS or masters than without.

As of July 2007 the total cost to take full time classes each semester plus expenses costs $8,893.00 and is expected to rise another 7% for the tuition each year. A lot of this expense can be minimized by living at home and finding books online. Still a lot of money no matter who you are but there is ways to work around some of the price that I will presenting.

 Applying for Financial Aid

 College prices are increasing at more that twice the rate of inflation for more than 20 years, the ability of many students and their families to pay for higher education is becoming national concern. Student financial services are becoming more critical in the college financial problem.

In order to be considered for financial aid you must first be admitted to a college. Make sure that you have completed your tax return and have a copy of it nearby. Then go to www.fafsa.ed.gov to apply for financial aid. It is necessary to do this as soon as possible since it could take at least 4 weeks to be approved and be contact by the college of your chose. There are also several reference guides that deal with merit, scholarships and other funding at most local and community college libraries.

Remember that you’ll need to fill out a new FAFSA before March 1st of each year. By meeting the priority deadline of March 1st, you can receive the maximum financial aid package you qualify for. If you don’t meet the priority deadline you may receive a lesser amount than you expect. Also if you want to check your financial aid status and see if there are any holds you can go online at most colleges and check.

Look for related links:

  1. student services
  2. student records
  3. student financial aid

 Student Loans

Another way to go is with federal loans, depending on what type of loan you apply for it could be have little no interest rate. Some don’t even charge interest until after you graduate. If you are considering applying for government backed loans, you will have to take loan entrance counseling and fill out a promissory note.

 Scholarships

There are several scholarships offered that vary by academic, financial need and community status. Most scholarships are awarded after summiting a summary on why you are requesting the scholarship.

Planning for Classes Well In Advance

 Not all classes are available at the same time or fit in with your schedule. The good news is that there are several night, weekend, and online classes that are design to fit all types of schedules. There are several guides and personnel that can help you develop a schedule of courses that fit to your schedule. Most classes can be taken at the nearest community college at a third the price of a 4 year college.

 When going back to college or attending for the first time as an alternative student you have to realize that it is an important lifestyle decision and that it will be stressful on you and your family.

family silouette In fact your ability to succeed depends a lot on how well your family co-operates, and is willing to be supportive and patient while you are away & studying. Make sure to thank them and appreciate what they are doing for you whenever possible.

Building your class schedule can be completed completely online using tools available at most colleges, even community colleges. Once you have a student number you will be able to access these sites. Always remember that taking these classes is a high priority. Failure in one class can affect you whole degree since graduating depends on your GPA not to mention the lack of available tuition assistance if your GPA falls.

 Registration

 I have tried desperately to find online when class registration begins and have failed each time. I can tell you on average class registration starts 4-5 months before the first day of class and that you should speak with a college representative around that time because they may be able to give you an exact date and help you register.

 Developing a Course Schedule

 

doctoral

As I previously mention advisers are usually available at each regional site every semester. Call you regional office to find out when your adviser will be visiting and to schedule an appointment. Talking with an adviser can save you a lot of time and money when planning on how to take your classes. It is not easy to know when classes will be available on-line and you usually need an academic adviser to admit you into the class you want to take. Pursuing my Masters, the student adviser was main person I talked to until I had to create me final thesis.

It is important not to overdue you first semester if you are a returning student. Maybe take one class for a semester and if it seems easy than take 2 or 3 the next semester. An important step when taking these classes is to talk t0

students who have taking the class before. They will be able to tell you if it was hard or easy and what the instructor expects.

 Finding Time for Everything

hard workingIf you are an alternative student it is usually because you have a family that you just can’t leave and go back to college full time. Going back to school as an alternative student is not just stressful for you but to your family to.

Keep your significant other informed, let her know as much as possible about what your learning and why it is important to there future. Remind that person that you would not be able to go to college at all if it wasn’t for there help with the kids. Make sure that if you have children that you let them in on what you are doing also. I let my family know that I was doing this to better not just my life but theirs also. Homework and classes on top of working 40+ hours a week and any other activities is really stressful but you have to make time for your family also. Try to finish your homework during the week even if you don’t get to watch your favorite TV show it is more important to have your Saturdays a little open to enjoy with friends and family so you don’t get burned out.

If you don’t think you will be able to finish an assignment on time you could talk to an instructor about getting an extension. Most college instructors realize that you have a job and are working harder than the regular student and want to help you find ways to achieve your degree. Even if this doesn’t sound like fun I have used some of my vacation days just to finish large assignments before they were do,

your not a teenager anymore you just can’t pull an all-nighter, doing so could jeopardize your job when you fall asleep at work.

Prepare for Post-College

 Congratulations on Graduating but you still need to find a job. Start by building a resume, finding a job, and preparing for that first professional interview.

2013 pay and unemployement

I added a graph to help motivate you a little more on getting your chosen degree. It shows the average  income levels & nu-employement based on education. The survey was done by the National Bureau of Labor and Statistics and published in 2013.

Education compared to Annual Income

 Creating a Resume

 A polished resume is crucial after graduating. Employers usually prefer a short to the point 1 page resume that contains all the pertinent personal information. Try to cut out the least important information to make it fit to one page. If you don’t have much work experience in your graduate field make sure to include your college degree at the beginning of your resume.

There are several places online that will help build your resume and even critique it for you. Check with you local community college also, there is usually a job placement counselor who is available and can be very useful. Check with the MyFSU student services tab online to find more information on job placement and resume building after graduation.

 Finding a Career

job search Most career searches are done online. Some of the best places to look online are:

Make sure to tell all your family and friends that you have graduated and looking for a new job. Some of the best positions near you will be found through social networking. You might of heard the expression “It doesn’t matter what you know, It’s who you know that matters.”

 Conclusion

I was offered several ways to achieve academic success which lead to professional success and a better life. I hope that I have made it a little easier to understand some of the steps in order to achieve success.

There are also several contact and extra information that are readably available on-line that you can pursue at you own leisure.

I do not believe that college is the only way, some very intelligent and not so have made it just by following their dreams.

A lot of positions require a higher degree of education…but not all.

 Works Cited

 Cassidy, Daniel J. The Scholarship Book 12th Edition. New York: Prentice Hall Press, July 2006

“Education and Income”. National Bureau of Labor and Statistics. 2002: 1-2

Gottesman, Greg. College Survival. New York: Prentice Hall, 1992

Osborne, AJ. Part-time clerical worker, Student Service Office for Extended Learning, Room 107. 20 April 2007

“University Center for Extended Learning: Ferris State University.” Ferris.edu, 07 July 2007, <http://www.ferris.edu/ucel/index>

Upcraft, Lee; Gardner, John; Barefoot, Betsy. Challenging and Supporting the First Year Student. California: Jossey-Bass, 2005