<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>backup &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:backup</link>
    <description>Personal Blog</description>
    <pubDate>Thu, 14 May 2026 02:39:36 +0000</pubDate>
    <item>
      <title>Bash scripting 8 - Backup</title>
      <link>https://personaljournal.ca/paulsutton/bash-scripting-8-backup</link>
      <description>&lt;![CDATA[Bash scripting 8 - Backup&#xA;&#xA;So moving on, making backups of files is generally a good idea, especially with the scripts we have been making&#xA;&#xA;echo &#34;Basic backup script&#34;&#xA;echo&#xA;append=-bak # set text to append to file&#xA;echo &#34;list files&#34;&#xA;echo&#xA;ls&#xA;echo&#xA;for file in .JPG # apply to all files ending with JPG&#xA;do&#xA;    filename=&#34;${file%.}&#34;&#xA;    cp $file ${filename}.JPG$append&#xA;done&#xA;echo &#34;backed up files&#34;&#xA;ls&#xA;&#xA;Tags&#xA;&#xA;#Bash,#Bashscripting,#BatchProcessing,#Backup&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Bash scripting 8 – Backup</p>

<p>So moving on, making backups of files is generally a good idea, especially with the scripts we have been making</p>

<pre><code class="language-bash">echo &#34;Basic backup script&#34;
echo
append=-bak # set text to append to file
echo &#34;list files&#34;
echo
ls
echo
for file in *.JPG # apply to all files ending with JPG
do
    filename=&#34;${file%.*}&#34;
    cp $file ${filename}.JPG$append
done
echo &#34;backed up files&#34;
ls

</code></pre>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:BatchProcessing" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BatchProcessing</span></a>,<a href="/paulsutton/tag:Backup" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Backup</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/bash-scripting-8-backup</guid>
      <pubDate>Sun, 29 Dec 2024 05:16:37 +0000</pubDate>
    </item>
  </channel>
</rss>