Commit 1b3e488c authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

Merge branch 'symlink-cronjob' into 'master'

Cleaning up with clearer variable names and better find command instead of ls

See merge request !538
parents a5cc64bf 64778342
......@@ -5,6 +5,7 @@ symlinkdest={{ local_directory_path }}/{{ lustre_storage_type }}
# Check that original lustre filesystem is mounted, exit if it isn't
if [ ! -d $originallfs ]; then
echo "Check that the filesystem $originalfs is mounted, exiting...";
exit 1
......@@ -17,11 +18,10 @@ if [ ! -d $symlinkdest ]; then
# Iterate over directories inside the original fs, create symlinks if they do _not_ exist
for subpath in `ls -1d "$originallfs"/*`; do
foldername=`basename "$subpath"`;
for sourcepath in `find "$originalfs" -maxdepth 1 -mindepth 1 -type d`; do
foldername=`basename "$sourcepath"`;
if [ ! -L $linkpath ]; then
#echo "Symlink does not exist";
ln -sT $subpath $linkpath;
ln -sT $sourcepath $linkpath;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment