<?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>Shell script &#8211; Arun&#8217;s blog</title>
	<atom:link href="https://arunns.net/category/development/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>https://arunns.net</link>
	<description>Arun&#039;s blog</description>
	<lastBuildDate>Sun, 22 Oct 2023 18:09:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.1</generator>
	<item>
		<title>Send attachments from command line with mutt</title>
		<link>https://arunns.net/send-attachments-from-command-line-with-mutt/</link>
					<comments>https://arunns.net/send-attachments-from-command-line-with-mutt/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Thu, 13 Feb 2014 08:54:49 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell script]]></category>
		<category><![CDATA[Send attachments from command line with mutt]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=783</guid>

					<description><![CDATA[To send e-mails from command line with attachments using mutt. Set the from address with EMAIL= -s &#8211; Subject -a &#8211; attachment file recipient name -c &#8211; for CC -b &#8211; for BCC create a text file (eg: /tmp/testmessage) , with the body of the message. EMAIL="foo@bar" mutt -s "Subject" -a test.doc foo1@bar -c foo2@bar [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>To send e-mails from command line with attachments using mutt.</p>
<p>Set the from address with EMAIL=<br />
-s &#8211; Subject<br />
-a &#8211; attachment file<br />
recipient name<br />
-c &#8211; for CC<br />
-b &#8211; for BCC<br />
create a text file (eg: /tmp/testmessage) , with the body of the message.</p>
<p><code>EMAIL="foo@bar" mutt -s "Subject" -a test.doc foo1@bar -c foo2@bar  < /tmp/testmessage
</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/send-attachments-from-command-line-with-mutt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Upgrade, Restore Drupal 7</title>
		<link>https://arunns.net/upgrade-restore-drupal-7/</link>
					<comments>https://arunns.net/upgrade-restore-drupal-7/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Tue, 08 Jan 2013 08:55:10 +0000</pubDate>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell script]]></category>
		<category><![CDATA[backup drupal 7]]></category>
		<category><![CDATA[Drupal 7]]></category>
		<category><![CDATA[restore drupal 7]]></category>
		<category><![CDATA[upgrade drupal 7]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=617</guid>

					<description><![CDATA[Shell script to upgrade and restore Drupal 7 website This script will take care of the necessary actions required for upgrading drupal to higher versions. USAGE Copy the script to your webserver. Edit the script and change the variables to match with your setup Give execute privilege to the owner of the script (chmod u+x [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Shell script to upgrade and restore Drupal 7 website</strong><br />
This script will take care of the necessary actions required for upgrading drupal to higher versions.</p>
<p><strong>USAGE</strong></p>
<ul>
<li>Copy the script to your webserver.</li>
<li>Edit the script and change the variables to match with your setup</li>
<li>Give execute privilege to the owner of the script (chmod u+x upgrade-restore-drupal7.sh)</li>
<li>Execute the script ./upgrade-restore-drupal7.sh</li>
</ul>
<p><strong>UPGRADE</strong></p>
<blockquote>
<pre><em>$ ./upgrade-restore-drupal7.sh 
 Please enter your choice:
 1. Update drupal
 2. Restore an old installation from backup
 3. Exit</em>
1
<em>Please enter the new drupal version (eg: 7.15) : 
</em>7.18
<em>Downloading drupal-7.18
Downloaded the the drupal version drupal-7.18
Current site backup is created: /home/foo/backups/08-01-2013-0938
Database backup created: /home/foo/backups/08-01-2013-0938.sql
Site is in maintanence mode now
Removed all drupal core files from destination
Copied the new version contents
Drupal updated to drupal-7.18
Site is active again, but please update your database, please visit http://&lt;yourwebsite&gt;/update.php to finalize the process
Removed the source files
</em></pre>
</blockquote>
<p><strong>RESTORE</strong></p>
<blockquote>
<pre><em>$ ./upgrade-restore-drupal7.sh 
 Please enter your choice:
 1. Update drupal
 2. Restore an old installation from backup
 3. Exit</em>
2
<em>List of available backups
08-01-2013-0753
08-01-2013-0758
08-01-2013-0804
08-01-2013-0841
08-01-2013-0849
08-01-2013-0858
08-01-2013-0900
08-01-2013-0904
08-01-2013-0905
08-01-2013-0938
Please enter the backup file name to restore: (eg: 08-01-2013-0753):</em> 
08-01-2013-0905
<em>Site is offline now
Removed production files
Restored the filesystem backup 
Restored the database
Site is restored
</em></pre>
</blockquote>
<p><script src="https://gist.github.com/4482287.js"></script></p>
<p><a href="https://github.com/arun-natarajan/upgrade-restore-drupal7"><b>View on github</b></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/upgrade-restore-drupal-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mysql backup script</title>
		<link>https://arunns.net/mysql-backup-script/</link>
					<comments>https://arunns.net/mysql-backup-script/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Tue, 05 Jan 2010 12:22:28 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Shell script]]></category>
		<category><![CDATA[compressed mysql backup]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[mysql backup]]></category>
		<category><![CDATA[mysql backup script]]></category>
		<category><![CDATA[mysql dump]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=146</guid>

					<description><![CDATA[Ensuring data integrity and security is paramount. Regular backups play a crucial role in safeguarding your MySQL databases against unforeseen disasters]]></description>
										<content:encoded><![CDATA[
<p>Ensuring data integrity and security is paramount. Regular backups play a crucial role in safeguarding your MySQL databases against unforeseen disasters</p>



<pre class="wp-block-code has-small-font-size"><code>#!/bin/bash


# Variables
DATE="$(date +"%d-%m-%Y")"
TIME="$(date +"%d-%m-%Y-%H%M")"
USER=username
PASSWORD=password
DATABASE=dbname

# Create backup directory with today's date
/bin/mkdir -p /backup/Mysql/$DATE

# Perform MySQL dump to the backup directory
/usr/bin/mysqldump -l -F -u $USER --password=$PASSWORD $DATABASE > /backup/Mysql/$DATE/backup_$TIME.sql

# Compress backup files
/usr/bin/bzip2 /backup/Mysql/*/*.sql

# Remove files older than x days (e.g., 90 days)
for i in `/usr/bin/find /backup/Mysql/ -maxdepth 1 -type d -mtime +90 -print`; do
    /bin/echo -e "Deleting old directories $i"
    /bin/rm -rf $i
done
</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/mysql-backup-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>script to convert OpenSSH keys to Tectia SSH Format</title>
		<link>https://arunns.net/script-to-convert-openssh-keys-to-tectia-and-tectia-to-openssh/</link>
					<comments>https://arunns.net/script-to-convert-openssh-keys-to-tectia-and-tectia-to-openssh/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 17:24:59 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell script]]></category>
		<category><![CDATA[SHELL SCRIPT]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[TECTIA SSH]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/blog/?p=97</guid>

					<description><![CDATA[bash script for converting OpenSSH keys to Tectia format and vice versa.    ]]></description>
										<content:encoded><![CDATA[<p>bash script for converting OpenSSH keys to Tectia format and vice versa.</p>
<pre> </pre>
<pre><code class="!whitespace-pre hljs language-bash"><span class="hljs-meta"> </span></code></pre>


<pre class="wp-block-code has-contrast-color has-text-color"><code>
#!/bin/bash
# Usage instructions
menu="
Make your choice:
1. Convert OpenSSH key to Tectia format
2. Convert Tectia key to OpenSSH format
3. Exit"

while :
do
printf "%s\n: " "$menu"
read choice
case $choice in
"1")
echo "Converting OpenSSH key to Tectia format"
echo "Enter the full path to the input key file:"
read input_path

if &#91; -f "$input_path" ]; then
ssh-keygen -e -f "$input_path" > "${input_path}.tectia"
echo "Tectia format key is saved as: ${input_path}.tectia"
else
echo "Input file does not exist."
fi
;;
"2")
echo "Converting Tectia key to OpenSSH format"
echo "Enter the full path to the input key file:"
read input_path

if &#91; -f "$input_path" ]; then
ssh-keygen -i -f "$input_path" > "${input_path}.openssh"
echo "OpenSSH format key is saved as: ${input_path}.openssh"
else
echo "Input file does not exist."
fi
;;
"3")
echo "Goodbye"
exit 0
;;
*)
echo "Wrong Choice"
;;
esac
done</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/script-to-convert-openssh-keys-to-tectia-and-tectia-to-openssh/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
