<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic script to loop through directories and encrypt all files using openssl into another directory in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880157#M99047</link>
    <description>I'm looking for a script that I could use to select a directory, and the script would look through that directory and all sub directories and perform an openssl encrypt against each file into a target directory tree while maintaing the same structure/permissions.... I know the openssl syntax, but don't understand the scripting necessary to loop through all the dirs.   This is a crude way to encrypt the data and allow to be stored in another location and restored when necessary.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sat, 14 Oct 2006 00:02:12 GMT</pubDate>
    <dc:creator>Mark C. LaFevre</dc:creator>
    <dc:date>2006-10-14T00:02:12Z</dc:date>
    <item>
      <title>script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880157#M99047</link>
      <description>I'm looking for a script that I could use to select a directory, and the script would look through that directory and all sub directories and perform an openssl encrypt against each file into a target directory tree while maintaing the same structure/permissions.... I know the openssl syntax, but don't understand the scripting necessary to loop through all the dirs.   This is a crude way to encrypt the data and allow to be stored in another location and restored when necessary.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Oct 2006 00:02:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880157#M99047</guid>
      <dc:creator>Mark C. LaFevre</dc:creator>
      <dc:date>2006-10-14T00:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880158#M99048</link>
      <description>The basic tool is "find" ("man find").  For&lt;BR /&gt;example, the following command will run&lt;BR /&gt;through "directory" and every file under it,&lt;BR /&gt;and echo each file name.  ("{}" represents&lt;BR /&gt;the name of the current file as it is&lt;BR /&gt;processed.):&lt;BR /&gt;&lt;BR /&gt;find directory -exec echo {} \;&lt;BR /&gt;&lt;BR /&gt;You can substitute the command you wish to&lt;BR /&gt;use for "echo {}".  "find" offers many file&lt;BR /&gt;selection options, too, such as "-type f",&lt;BR /&gt;which would eliminate the directories&lt;BR /&gt;themselves:&lt;BR /&gt;&lt;BR /&gt;find gzip -type f -exec echo {} \;&lt;BR /&gt;&lt;BR /&gt;Strictly speaking, that selects only the&lt;BR /&gt;regular files, which excludes directories and&lt;BR /&gt;some other things, too.  A more precise way&lt;BR /&gt;to eliminate the directories would be to&lt;BR /&gt;exclude the directories, rather than to&lt;BR /&gt;accept only the regular files:&lt;BR /&gt;&lt;BR /&gt;find gzip '!' -type d -exec echo {} \;&lt;BR /&gt;&lt;BR /&gt;If you could better describe your actual&lt;BR /&gt;requirements, there's almost certainly a&lt;BR /&gt;better method than your apparent plan.&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Oct 2006 00:54:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880158#M99048</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-14T00:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880159#M99049</link>
      <description>I don't know the openssl command/syntax but here's a command that will go thru your source dir (including subdirs) and copy them to a target dir while preserving the structure, permissions etc.&lt;BR /&gt;&lt;BR /&gt;# cd &lt;SOURCE_DIR&gt; &amp;amp;&amp;amp; find . -depth -print | cpio -pdumv &lt;TARGET_DIR&gt;&lt;BR /&gt;&lt;BR /&gt;~hope it helps&lt;/TARGET_DIR&gt;&lt;/SOURCE_DIR&gt;</description>
      <pubDate>Sat, 14 Oct 2006 01:12:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880159#M99049</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-10-14T01:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880160#M99050</link>
      <description>my sytax for the openssl is&lt;BR /&gt;&lt;BR /&gt;openssl enc -aes-256-cbc -pass pass:mypass -e -salt -in myinfile -out myout.ssl&lt;BR /&gt;&lt;BR /&gt;I have one dir with about 6 sub dir's and under that may be more sub dirs... I need a quick way to encrypt all data in the dir tree and move them into another location while hopefully maintaining the dir structure so those files could easily and quicky recovered to the original locations.</description>
      <pubDate>Sat, 14 Oct 2006 08:42:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880160#M99050</guid>
      <dc:creator>Mark C. LaFevre</dc:creator>
      <dc:date>2006-10-14T08:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880161#M99051</link>
      <description>... -in {} -out another_location/{} ...&lt;BR /&gt;&lt;BR /&gt;You'd probably need to make the destination directories first, but that could be&lt;BR /&gt;scripted, too.  Crudely:&lt;BR /&gt;&lt;BR /&gt;find directory -type d -exec mkdir another_location/{} \;&lt;BR /&gt;&lt;BR /&gt;Oops.  Earlier references to "gzip" were&lt;BR /&gt;caused by thoughtless copy-paste from an&lt;BR /&gt;example I was running.  Please read them as&lt;BR /&gt;"directory".&lt;BR /&gt;&lt;BR /&gt;I assume that "another location" is easily&lt;BR /&gt;accessible in the file system, not requiring&lt;BR /&gt;FTP or something.</description>
      <pubDate>Sat, 14 Oct 2006 08:58:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880161#M99051</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-14T08:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880162#M99052</link>
      <description>Hi Mark:&lt;BR /&gt;&lt;BR /&gt;One way would be to 'tar' (using *relative* paths) your source directory; encrypt the tarball; and un-tar it in your destination directory.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 14 Oct 2006 09:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880162#M99052</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-10-14T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880163#M99053</link>
      <description>We seem to be hitting an issue with openssl working on a file greater than 2gb, we tried the tar and then encrypt, but wouldn't work, hoping to encrypt all the smaller files, then tar.</description>
      <pubDate>Sat, 14 Oct 2006 09:37:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880163#M99053</guid>
      <dc:creator>Mark C. LaFevre</dc:creator>
      <dc:date>2006-10-14T09:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880164#M99054</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;use Sandmans/Stevens approach - slightly modified - to create the destination directory structure:&lt;BR /&gt;&lt;BR /&gt;cd source&lt;BR /&gt;find . -type d | cpio -pd destination&lt;BR /&gt;&lt;BR /&gt;In the second step take care for the files (untested!):&lt;BR /&gt;&lt;BR /&gt;find . -type f -exec openssl enc -aes-256-cbc -pass pass:mypass -e -salt -in {} -out destination/{}.ssl \;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Sat, 14 Oct 2006 13:51:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880164#M99054</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-10-14T13:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: script to loop through directories and encrypt all files using openssl into another directory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880165#M99055</link>
      <description>slight variation on Peter's solution...&lt;BR /&gt;&lt;BR /&gt;# cd &lt;SOURCEDIR&gt; &amp;amp;&amp;amp; find . -type f | cpio -pdumv &lt;TARGETDIR&gt; | xargs -i openssl enc -aes-256-cbc -pass pass:mypass -e -salt -in {} -out {}.ssl&lt;/TARGETDIR&gt;&lt;/SOURCEDIR&gt;</description>
      <pubDate>Sat, 14 Oct 2006 17:39:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-loop-through-directories-and-encrypt-all-files-using/m-p/3880165#M99055</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-10-14T17:39:12Z</dc:date>
    </item>
  </channel>
</rss>

