<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.snic.se/w/index.php?action=history&amp;feed=atom&amp;title=SweStore%2Fswetrans_arc</id>
	<title>SweStore/swetrans arc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.snic.se/w/index.php?action=history&amp;feed=atom&amp;title=SweStore%2Fswetrans_arc"/>
	<link rel="alternate" type="text/html" href="https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;action=history"/>
	<updated>2026-06-29T10:21:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.10</generator>
	<entry>
		<id>https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=7992&amp;oldid=prev</id>
		<title>Niklas Edmundsson (HPC2N): Swestore documentation moved</title>
		<link rel="alternate" type="text/html" href="https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=7992&amp;oldid=prev"/>
		<updated>2023-02-08T13:09:24Z</updated>

		<summary type="html">&lt;p&gt;Swestore documentation moved&lt;/p&gt;
&lt;a href=&quot;https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;amp;diff=7992&amp;amp;oldid=5193&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Niklas Edmundsson (HPC2N)</name></author>
		
	</entry>
	<entry>
		<id>https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=5193&amp;oldid=prev</id>
		<title>Niklas Edmundsson (HPC2N): moved SweStore/swstrans arc to SweStore/swetrans arc: Spelling error</title>
		<link rel="alternate" type="text/html" href="https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=5193&amp;oldid=prev"/>
		<updated>2013-05-27T13:21:35Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/wiki/SweStore/swstrans_arc&quot; class=&quot;mw-redirect&quot; title=&quot;SweStore/swstrans arc&quot;&gt;SweStore/swstrans arc&lt;/a&gt; to &lt;a href=&quot;/wiki/SweStore/swetrans_arc&quot; class=&quot;mw-redirect&quot; title=&quot;SweStore/swetrans arc&quot;&gt;SweStore/swetrans arc&lt;/a&gt;: Spelling error&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:21, 27 May 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Niklas Edmundsson (HPC2N)</name></author>
		
	</entry>
	<entry>
		<id>https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=4223&amp;oldid=prev</id>
		<title>Jonas Lindemann (LUNARC) at 08:25, 15 June 2012</title>
		<link rel="alternate" type="text/html" href="https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=4223&amp;oldid=prev"/>
		<updated>2012-06-15T08:25:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 08:25, 15 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;#!/bin/bash &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/ins&gt;&amp;gt;#!/bin/bash &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function error_quit {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function error_quit {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l186&quot; &gt;Line 186:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 186:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;echo 'Done: ' `date +%c`| tee -a $logfile&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;echo 'Done: ' `date +%c`| tee -a $logfile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;exit 0&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;exit 0&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jonas Lindemann (LUNARC)</name></author>
		
	</entry>
	<entry>
		<id>https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=4222&amp;oldid=prev</id>
		<title>Jonas Lindemann (LUNARC) at 08:25, 15 June 2012</title>
		<link rel="alternate" type="text/html" href="https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=4222&amp;oldid=prev"/>
		<updated>2012-06-15T08:25:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 08:25, 15 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;#!/bin/bash &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/ins&gt;&amp;gt;#!/bin/bash &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function error_quit {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function error_quit {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l186&quot; &gt;Line 186:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 186:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;echo 'Done: ' `date +%c`| tee -a $logfile&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;echo 'Done: ' `date +%c`| tee -a $logfile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;exit 0&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;exit 0&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jonas Lindemann (LUNARC)</name></author>
		
	</entry>
	<entry>
		<id>https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=4220&amp;oldid=prev</id>
		<title>Jonas Lindemann (LUNARC): Created page with &quot;&lt;pre&gt;#!/bin/bash   function error_quit {     echo -e &quot;$@&quot;     echo     echo -e 'Usage:'     echo -e 'swstrans from|to [-r] from  to'     echo -e '-r:\t potional; remove copied fi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://docs.snic.se/w/index.php?title=SweStore/swetrans_arc&amp;diff=4220&amp;oldid=prev"/>
		<updated>2012-06-15T08:23:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt;#!/bin/bash   function error_quit {     echo -e &amp;quot;$@&amp;quot;     echo     echo -e &amp;#039;Usage:&amp;#039;     echo -e &amp;#039;swstrans from|to [-r] from  to&amp;#039;     echo -e &amp;#039;-r:\t potional; remove copied fi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#!/bin/bash &lt;br /&gt;
&lt;br /&gt;
function error_quit {&lt;br /&gt;
    echo -e &amp;quot;$@&amp;quot;&lt;br /&gt;
    echo&lt;br /&gt;
    echo -e 'Usage:'&lt;br /&gt;
    echo -e 'swstrans from|to [-r] from  to'&lt;br /&gt;
    echo -e '-r:\t potional; remove copied files'&lt;br /&gt;
    echo -e 'from:\t origin path; can include &amp;quot;*&amp;quot;, &amp;quot;?&amp;quot; as wildcards'&lt;br /&gt;
    echo -e 'to:\t destination directory name ending with &amp;quot;/&amp;quot;'&lt;br /&gt;
    echo&lt;br /&gt;
    echo -e 'Example:'&lt;br /&gt;
    echo -e &amp;quot;swstrans to './run_1/fld*' JET/&amp;quot;&lt;br /&gt;
    echo -e 'Copies files fld* from local ./run_1/ to srm://srm.swegrid.se/snic/dnsturb/JET/'&lt;br /&gt;
    echo&lt;br /&gt;
    echo -e &amp;quot;swstrans from 'JET/fld*' ./run_1/&amp;quot;&lt;br /&gt;
    echo -e 'Copies files fld* from srm://srm.swegrid.se/snic/dnsturb/JET/ to local ./run_1/'&lt;br /&gt;
    exit 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# parameters&lt;br /&gt;
srm_pth='srm://srm.swegrid.se/snic/'&lt;br /&gt;
srm_dom='dnsturb/'&lt;br /&gt;
swstr=$srm_pth$srm_dom&lt;br /&gt;
srm_cp='arccp'&lt;br /&gt;
srm_cp_opt=' --retries=3 --timeout=30'&lt;br /&gt;
srm_ls='arcls'&lt;br /&gt;
srm_rm='arcrm'&lt;br /&gt;
loc_rm='rm'&lt;br /&gt;
loc_mkdir='mkdirhier'&lt;br /&gt;
loc_ls='ls'&lt;br /&gt;
logfile='log_file'&lt;br /&gt;
errorfile='error_file'&lt;br /&gt;
awk='awk'&lt;br /&gt;
sed='sed'&lt;br /&gt;
&lt;br /&gt;
# variables&lt;br /&gt;
remove=0&lt;br /&gt;
file_list=''&lt;br /&gt;
error_files=''&lt;br /&gt;
copied_files=''&lt;br /&gt;
&lt;br /&gt;
# arguments&lt;br /&gt;
args=(&amp;quot;$@&amp;quot;)&lt;br /&gt;
argsnr=$#&lt;br /&gt;
&lt;br /&gt;
# check arguments&lt;br /&gt;
# parameters number check&lt;br /&gt;
if [ $[argsnr] -lt 3 -o $[argsnr] -gt 4 ]; then&lt;br /&gt;
    error_quit 'Wrong arguments number!'&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# take paths&lt;br /&gt;
path_from=&amp;quot;${args[$[argsnr-2]]}&amp;quot;&lt;br /&gt;
path_to=&amp;quot;${args[$[argsnr-1]]}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# separate directory and base names&lt;br /&gt;
base_from=&amp;quot;${path_from##*/}&amp;quot;&lt;br /&gt;
dir_from=&amp;quot;${path_from:0:${#path_from} - ${#base_from}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
base_to=&amp;quot;${path_to##*/}&amp;quot;&lt;br /&gt;
dir_to=&amp;quot;${path_to:0:${#path_to} - ${#base_to}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# we don't overwrite any files, so base_to should be empty&lt;br /&gt;
if [ &amp;quot;${base_to}&amp;quot; != &amp;quot;&amp;quot;  ]; then&lt;br /&gt;
    error_msg='path_to should be directory name ending with &amp;quot;/&amp;quot;'&lt;br /&gt;
    error_quit ${error_msg}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# change unix wildcards for awk&lt;br /&gt;
set -f&lt;br /&gt;
base_from=$(echo ${base_from}|$sed -e 's/\./\\./g' -e 's/\*/\.\*/g' -e 's/\?/\./g')&lt;br /&gt;
base_from=&amp;quot;/^&amp;quot;$base_from&amp;quot;$/ {print}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# first parameter check&lt;br /&gt;
case &amp;quot;${args[0]}&amp;quot; in&lt;br /&gt;
    from)&lt;br /&gt;
# check directories&lt;br /&gt;
# from&lt;br /&gt;
# create sestore path removing leading ./&lt;br /&gt;
	dir_from=$swstr$(echo ${dir_from}| $sed -e 's/^\.//' -e 's/^\///')&lt;br /&gt;
	`$srm_ls $dir_from 1&amp;gt;/dev/null 2&amp;gt;/dev/null`&lt;br /&gt;
	if [ $? -ne 0 ]; then&lt;br /&gt;
	    echo &amp;quot;Input directory: &amp;quot;${dir_from}&amp;quot; does not exist.&amp;quot;| tee -a $logfile&lt;br /&gt;
	    exit 1&lt;br /&gt;
	fi&lt;br /&gt;
# to&lt;br /&gt;
	if [ ! -d  ${dir_to} ]; then&lt;br /&gt;
	    echo &amp;quot;Output directory: &amp;quot;${dir_to}&amp;quot; does not exist on local machine.&amp;quot;| tee -a $logfile&lt;br /&gt;
	    echo &amp;quot;Creating: &amp;quot;${dir_to}| tee -a $logfile&lt;br /&gt;
	    `$loc_mkdir ${dir_to} 1&amp;gt;/dev/null`&lt;br /&gt;
	    if [ $? -ne 0 ]; then&lt;br /&gt;
		echo &amp;quot;Cannot create: &amp;quot;${dir_to}| tee -a $logfile&lt;br /&gt;
		exit 1&lt;br /&gt;
	    fi&lt;br /&gt;
	elif [ -L ${dir_to}  ]; then&lt;br /&gt;
	    echo &amp;quot;Output directory: &amp;quot;${dir_to}&amp;quot; is a symbolic link!&amp;quot;| tee -a $logfile&lt;br /&gt;
	    exit 1&lt;br /&gt;
	fi&lt;br /&gt;
# get file list&lt;br /&gt;
	file_list=`$srm_ls $dir_from 2&amp;gt;/dev/null | $awk &amp;quot;$base_from&amp;quot;`&lt;br /&gt;
#	file_list=$($srm_ls $dir_from 2&amp;gt;/dev/null | $awk '/f./ {print}')&lt;br /&gt;
# set rm, ls command&lt;br /&gt;
	rm=$srm_rm&lt;br /&gt;
	ls=$loc_ls&lt;br /&gt;
	;;&lt;br /&gt;
    to)&lt;br /&gt;
# check directories&lt;br /&gt;
# from&lt;br /&gt;
	if [ ! -d  ${dir_from} ]; then&lt;br /&gt;
	    echo &amp;quot;Input directory: &amp;quot;${dir_from}&amp;quot; does not exist on local machine!&amp;quot;| tee -a $logfile&lt;br /&gt;
	    exit 1&lt;br /&gt;
	fi&lt;br /&gt;
# to&lt;br /&gt;
# create sestore path removing leading ./&lt;br /&gt;
	dir_to=$swstr$(echo ${dir_to}| $sed -e 's/^\.//' -e 's/^\///')&lt;br /&gt;
	`$srm_ls $dir_to 1&amp;gt;/dev/null 2&amp;gt;/dev/null`&lt;br /&gt;
	if [ $? -ne 0 ]; then&lt;br /&gt;
	    echo &amp;quot;Output directory: &amp;quot;${dir_to}&amp;quot; does not exist.&amp;quot;| tee -a $logfile&lt;br /&gt;
	    echo &amp;quot;It will be created by &amp;quot;${srm_cp}&amp;quot; during copying files.&amp;quot;| tee -a $logfile&lt;br /&gt;
	fi&lt;br /&gt;
# get file list&lt;br /&gt;
	file_list=`$loc_ls $dir_from 2&amp;gt;/dev/null | $awk &amp;quot;$base_from&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
# set rm, ls command&lt;br /&gt;
	rm=$loc_rm&lt;br /&gt;
	ls=$srm_ls&lt;br /&gt;
	;;&lt;br /&gt;
    *) error_quit 'Wrong option'&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# check remove option&lt;br /&gt;
if [ $[argsnr] -eq 4 -a &amp;quot;${args[1]}&amp;quot; == &amp;quot;-r&amp;quot; ]; then&lt;br /&gt;
    remove=1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# check file_list&lt;br /&gt;
if [ &amp;quot;$file_list&amp;quot; == &amp;quot;&amp;quot; ]; then&lt;br /&gt;
    echo 'List of files is empty; nothing to do'| tee -a $logfile&lt;br /&gt;
    exit 0&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# copy files&lt;br /&gt;
for file in ${file_list}; do&lt;br /&gt;
# we don't want to overwrite files, so check if the file exists&lt;br /&gt;
    `$ls $dir_to$file 1&amp;gt;/dev/null 2&amp;gt;/dev/null`&lt;br /&gt;
    if [ $? -ne 0 ]; then&lt;br /&gt;
	echo 'Copying file: '$dir_from$file' to '$dir_to | tee -a $logfile&lt;br /&gt;
	$srm_cp $srm_cp_opt $dir_from$file $dir_to 1&amp;gt;/dev/null 2&amp;gt; /dev/null&lt;br /&gt;
	if [ $? -eq 0 ]; then&lt;br /&gt;
	    echo 'Done: ' $dir_from$file `date +%c`| tee -a $logfile&lt;br /&gt;
	    copied_files=$copied_files' '$file&lt;br /&gt;
	else&lt;br /&gt;
	    echo 'ERROR copying: '$dir_from$file' transfer problem.' | tee -a $logfile&lt;br /&gt;
	    error_files=$error_files' '$file&lt;br /&gt;
	fi&lt;br /&gt;
    else&lt;br /&gt;
	echo 'ERROR copying: '$dir_from$file'; file: '$dir_to$file' exists. Skipping.' | tee -a $logfile&lt;br /&gt;
	error_files=$error_files' '$file&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# removing copied files&lt;br /&gt;
if [ $[remove] -eq 1 ]; then&lt;br /&gt;
    for file in $copied_files; do&lt;br /&gt;
	echo 'Removing file: '$dir_from$file | tee -a $logfile&lt;br /&gt;
	`$rm $dir_from$file 1&amp;gt;/dev/null 2&amp;gt;/dev/null`&lt;br /&gt;
	if [ $? -eq 0 ]; then&lt;br /&gt;
	    echo $dir_from$file ' removed' | tee -a $logfile&lt;br /&gt;
	else&lt;br /&gt;
	    echo 'ERROR removing file: '$dir_from$file | tee -a $logfile&lt;br /&gt;
	fi&lt;br /&gt;
    done&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# output error list&lt;br /&gt;
if [ &amp;quot;$error_files&amp;quot; != &amp;quot;&amp;quot; ]; then&lt;br /&gt;
    echo 'Files not copied:' | tee -a $errorfile&lt;br /&gt;
    for file in $error_files; do&lt;br /&gt;
	echo $dir_from$file | tee -a $errorfile&lt;br /&gt;
    done&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo 'Done: ' `date +%c`| tee -a $logfile&lt;br /&gt;
&lt;br /&gt;
exit 0&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jonas Lindemann (LUNARC)</name></author>
		
	</entry>
</feed>