Hey I am alive!

Hey people and bots,

I just wanted to say that I am alive but just too busy to maintain the blog (Well to be honest I also don’t enjoy writing as much as I did earlier, I don’t know why this happens to me with all the blogs I created…). The last post I wrote was 3 months ago and great things happened here in Uruguay, our national team ended up 4th in the FIFA World Cup, one thing that didn’t happen since 1970 when my fathers were just teenagers. Also AM Technology & Systems is getting bigger and bigger every day so this also consume almost all my day. That’s why I came up with this idea to revitalize this blog, instead of writing stuff that only bots and crawlers read all the time, I thought that would be great if you just tell me ideas for posts and I will just write about them, for example “How can I install XYZ software”, “How do I do XYZ stuff”, etc.

I think it’s better to write useful howtos for real people that just writing non-sense things that are only useful for me, besides I really got visitors attention on the FFMPEG Installation howto for Clip-Bucket . So don’t be shay and leave me some comments about what you want me to write, I think it will be funny because I will take it as a challenge and I love challenges :)

Thank you for stopping by!

Cheers,

Andres

Change timezone from UTC to GMT using an automatic script

Hi,

If you are using alestic Ubuntu AMIs for AWS/EC2 the timezone is UTC by default, I had to change that to GMT for a customer here is a way to do it automatically in your build script or without human intervention:

echo “Etc/GMT” | tee /etc/timezone
dpkg-reconfigure –frontend noninteractive tzdata

Note: The –frontend option has two – in front

You can check more timezones at the directory /usr/share/zoneinfo/

Hope it helps you!

Cheers!

How to backup and restore crontab

Hi folks,

Today I had to come up with a solution for a customer using AWS/EC2 to make their crontab resilient to server re-builds in case it goes down by autoscaler or other situations. That’s why I created a script that is called daily that backups the crontab of a specific user to a file in an EBS mounted volume maintaining a 7 days library just in case :) :

#!/bin/bash

find /data -maxdepth 1 -name ‘bkp-crontab-*’ -mtime 7 -exec rm {} \;
crontab -l -u YOUR_USER_GOES_HERE > /data/bkp-crontab-`date +%Y-%m-%d`

Then to recover the last backup of crontab for the user you can put this in your server script when you are building it:

cat `ls -tr /data/bkp-crontab-* | tail -1` | crontab -u YOUR_USER_GOES_HERE -

This will load the last backup file in the users crontab.

I hope this helps you to have your crontabs backed up ;)

Cheers!