<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tesna.net &#187; Linux</title>
	<atom:link href="http://tesna.net/category/technology/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://tesna.net</link>
	<description>Just some random thoughts of me</description>
	<lastBuildDate>Tue, 02 Mar 2010 08:28:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to automatically backup a directory and FTP/email it using script and cron</title>
		<link>http://tesna.net/2008/12/18/how-to-automatically-backup-a-directory-and-ftp-email-using-script-and-cron</link>
		<comments>http://tesna.net/2008/12/18/how-to-automatically-backup-a-directory-and-ftp-email-using-script-and-cron#comments</comments>
		<pubDate>Thu, 18 Dec 2008 00:00:13 +0000</pubDate>
		<dc:creator>Tesna</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://tesna.net/?p=146</guid>
		<description><![CDATA[I was looking a simple way to automatically backup my files on the server then automatically sends them to designated email address. Since I have quite limited storage space on my server, then sending it to one of my email account hosted on Google Apps it would be almost ideal for storage backups since Google [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I was looking a simple way to automatically backup my files on the server then automatically sends them to designated email address. Since I have quite limited storage space on my server, then sending it to one of my email account hosted on Google Apps it would be almost ideal for storage backups since Google Apps email account has large storage space (7GB).</p>
<p><span id="more-146"></span></p>
<p style="text-align: justify;">After some googling, I found a bash script on <a title="Ameir Abdeldayem" href="http://www.ameir.net" target="_blank">ameir.net</a>, which I thought it would be perfect for the job. But unfortunately gmail refused to receive the backups emails since its larger than 20MB/message. Then I modified the script to allow the backup files compressed using tar.gz format (previously its using .zip format), automatically splitting them every 15MB, and finally sends each individual attachment. Just put the code somewhere in your server, then configure cron to execute it how often you want your files to be backed up.</p>
<p style="text-align: justify;">PS: on ameir.net I&#8217;ve also found a <a href="http://www.ameir.net/blog/index.php?/archives/18-MySQL-Backup-to-FTP-and-Email-Shell-Script-for-Cron-v2.1.html" target="_blank">script</a> to dump mysql database and sends them to email. You should check out the website.</p>
<pre lang="bash">
#! /bin/bash# Ameir Abdeldayem# http://www.ameir.net# You are free to modify and distribute this code,# so long as you keep my name and URL in it.
# Last modified: August 1, 2006
#-------------------------------------------------------------
# your server's name
SERVER=servername.yourdomain.com
# directory to backup to
BACKDIR=~/backups
# date format that is appended to filename
DATE=`date +'%m-%d-%Y'`
# directories to backup, separated by a space
# if this script is a level above a directory you want to backup,
# you can simply enter its name, otherwise, type the absolute path,
# with or without a trailing slash.
DIRS="/your/directory/"
# set to 'y' if you want to backup all your folders. this will backup
# all files and folders in the script's parent directory
BACKALL=n
#----------------------Mail Settings--------------------#
# set to 'y' if you'd like to be emailed the backup (requires mutt)
MAIL=y
# email addresses to send backups to, separated by a space
EMAILS="youremail@yordomain.com"
# email subject
SUBJECT="Directory Backup on $SERVER ($DATE)"
#----------------------FTP Settings--------------------#
# set "FTP=y" if you want to enable FTP backups
FTP=n
# FTP server settings; should be self-explanatory
FTPHOST="ftp.server.com"
FTPUSER="user"
FTPPASS="password"
# directory to backup to. if it doesn't exist, file will be uploaded to
# first logged-in directory
FTPDIR="backups"
#-------------------Deletion Settings-------------------#
# delete old files?
DELETE=y
# how many days of backups do you want to keep?
DAYS=3
#----------------------End of Settings------------------#
# check of the backup directory exists
# if not, create it
if [ -e $BACKDIR ]
then
echo Backups directory already exists
else
mkdir $BACKDIR
fi
# This is a list of folders to be backed up.
# You can add more entries if you want more
# directories to be backed up. The ${PWD##*/}
# from the first entry gets the base name from
# the current directory and uses it in the filename.
# Format: zip -9 -r (where to save) (what to backup).
# Be sure to include $BACKDIR/ in the beginning
# so that the file is saved in the backup directory.
if [ $BACKALL = "y" ]
then
echo Backing up entire parent directory...
tar cfz $BACKDIR/${PWD##*/}-backup-$SERVER-$DATE.zip ./
else
echo Backing up selected directories...
for directory in $DIRS
do
DIR=`echo $directory | sed -e 's/^\///g' -e 's/\/$//g' -e 's/~//g' -e 's/\.//g' -e 's/home\///g' -e 's/\//_/g'`
echo Backing up folder named $directory as $DIR...
tar cfz $BACKDIR/$DIR-backup-$SERVER-$DATE.tar.gz $directory
split -b 15m $BACKDIR/$DIR-backup-$SERVER-$DATE.tar.gz $BACKDIR/$DIR-backup-$SERVER-$DATE.tar.gz
done
fi
if [ $MAIL = "y" ]
then
BODY="Your backup is ready!"
ATTACH=`for filea in $BACKDIR/*$DATE.tar.gzaa; do echo -n "-a ${filea} "; done`
echo $BODY | mutt -s "$SUBJECT" $ATTACH $EMAILS
echo "Your backup part 1 has been emailed to you!"
ATTACH2=`for fileb in $BACKDIR/*$DATE.tar.gzab; do echo -n "-a ${fileb} "; done`
echo $BODY | mutt -s "$SUBJECT" $ATTACH2 $EMAILS
echo "Your backup part 2 has been emailed to you!"
ATTACH3=`for filec in $BACKDIR/*$DATE.tar.gzac; do echo -n "-a ${filec} "; done`
echo $BODY | mutt -s "$SUBJECT" $ATTACH3 $EMAILS
echo "Your backup part 3 has been emailed to you!"
ATTACH4=`for filed in $BACKDIR/*$DATE.tar.gzad; do echo -n "-a ${filed} "; done`
echo $BODY | mutt -s "$SUBJECT" $ATTACH4 $EMAILS
echo "Your backup part 4 has been emailed to you!"
fi
if [ $FTP = "y" ]
then
cd $BACKDIR
ATTACH=`for file in *$DATE.tar.gz; do echo -n -e "put ${file}\n"; done`
ftp -nv <open $FTPHOST
user $FTPUSER $FTPPASS
cd $FTPDIR
$ATTACH
quit
EOF
fi
if [ $DELETE = "y" ]
then
find $BACKDIR -name "*.tar.gz*" -mtime $DAYS -exec rm {} \;
if [ $DAYS = "1" ]
then
echo "Yesterday's backup has been deleted"
else
echo "The backup from $DAYS days ago has been deleted"
fi
fi
echo Your backup is complete!
</pre>
<p></open></pre>
]]></content:encoded>
			<wfw:commentRss>http://tesna.net/2008/12/18/how-to-automatically-backup-a-directory-and-ftp-email-using-script-and-cron/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.0.4 64-bit</title>
		<link>http://tesna.net/2008/08/03/ubuntu-804-64-bit</link>
		<comments>http://tesna.net/2008/08/03/ubuntu-804-64-bit#comments</comments>
		<pubDate>Sun, 03 Aug 2008 06:33:12 +0000</pubDate>
		<dc:creator>Tesna</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ubuntu linux thinkpad t61]]></category>

		<guid isPermaLink="false">http://tesna.net/?p=38</guid>
		<description><![CDATA[Whoa, it&#8217;s been a while I&#8217;m not updating my blog. I just want to share my experience after using ubuntu 8.0.4 64 -bit for over a month. I&#8217;m installing ubuntu on my notebook. It&#8217;s a Thinkpad T61, with Intel C2D 7300 2.0 Ghz processor, 4 GB ram, Nvidia Quadro NVS 140m, 250 GB hdd etc. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Whoa, it&#8217;s been a while I&#8217;m not updating my blog. I just want to share my experience after using ubuntu 8.0.4 64 -bit for over a month. I&#8217;m installing ubuntu on my notebook. It&#8217;s a Thinkpad T61, with Intel C2D 7300 2.0 Ghz processor, 4 GB ram, Nvidia Quadro NVS 140m, 250 GB hdd etc. It is the easiest installation of OS ever. Most my peripherals and devices are detected correctly. My wireless card, bluetooth, functions keys, etc are working out of the box. Maybe I&#8217;m just lucky, when I installing ubuntu on both my friend&#8217;s laptop, the wireless is not working out of the box. But it can easily solved by downloading newest drivers. Currently I&#8217;m dual booting with Vista x64 SP1.</p>
<p><span id="more-38"></span></p>
<p style="text-align: justify;">The only driver I download just the nvidia graphics driver, but that&#8217;s only took few clicks away and you only need to download it if you want to enable 3d and desktop effects. To be honest, I kinda like desktop effects/eye candy, multiple desktop + 3d cube, wobbly &amp; 3d windows, etc. Two of my friends already asks me to install ubuntu on their notebook, just by looking ubuntu&#8217;s visual effects. Apart from visually appealing, multiple virtual desktops proven really useful for me.</p>
<p style="text-align: justify;">To install additional things such as codecs to play various type of audio and video files, flashplayer, java virtual machine, etc also relatively easy, all the guides can be found on ubuntuforums.com . Maybe I will compile all essential guides on my blog sometime later.</p>
<p style="text-align: justify;">Performance wise, it does boots faster than my windows vista x64 sp1. But since I got quite large amount of ram, running applications such as spreadsheets, email client, internet browser, etc feels the same on both OS.</p>
<p style="text-align: justify;">Stability wise, both os has similar results on me. I never got any unexpected crash on both OS.</p>
<p style="text-align: justify;">Security wise, it seems ubuntu is the winner. I don&#8217;t need to use any antivirus software, since most viruses and malware are written for windows systems. This not means that linux is not vulnerable to malicious code though, it&#8217;s just got much less chance to get infected/compromised.</p>
<p style="text-align: justify;">Office Application wise, this one windows seems still the winner. Altough there is OpenOffce suite installed default in ubuntu, I still have not found replacement for Excel 2007.  I need this for work, as I&#8217;m using some functions which only available in Excel 2007.  To overcome this I&#8217;m installing Windows XP and install Excel 2007 inside Vmware in Ubuntu. I tried to install Excel 2007 on wine, it does run, but the excel often crashes, especially when I clicked on save. One more thing, I have not found a way to sync my Windows Mobile 6.1 PDA with linux, so I still need Windows in Vmware to sync my contacts, appointments, etc.</p>
<p style="text-align: justify;">UPDATE: I got Office Word &amp; Excel 2007 instlaled in linux using wine! The guide can be found in ubuntuforums.org. But when working on large excel files, sometimes the application just crashed.</p>
<p style="text-align: justify;">Games wise, of course windows still the best, but I don&#8217;t games often so it is not a problem for me.</p>
<p style="text-align: justify;">Value wise, ubuntu is free with open office installed as default, in my opinion it&#8217;s comparable with Microsoft Office 2003. Ubuntu also has large application repository, with access to thousands of free and/or opensource applications. Just enable the additional repo, browse using synaptics, select, install! So ubuntu is the winner.</p>
<p style="text-align: justify;">In addition, I&#8217;m also found a way to sync songs my jailbroken iPod Touch in linux wirelessly using rythymbox, something you can not do yet on windows (or mac maybe?) I found the guide from the net, with few modified lines in the scripts to allow passwordless mount.</p>
]]></content:encoded>
			<wfw:commentRss>http://tesna.net/2008/08/03/ubuntu-804-64-bit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
