Skip to content

Commit 2dcf70e

Browse files
committed
ssh: archieve files the symlink points to instead of symlink iteself
See https://stackoverflow.com/a/5076204/9567349.
1 parent 6474e4a commit 2dcf70e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dpdispatcher/ssh_context.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ def _walk_directory(self, files, work_path, file_list, directory_list):
282282
for name in files:
283283
file_list.append(os.path.join(root, name))
284284
elif glob(file_name):
285+
print(file_name)
285286
# If the file name contains a wildcard, os.path functions will fail to identify it. Use glob to get the complete list of filenames which match the wildcard.
286287
abs_file_list = glob(file_name)
287288
rel_file_list = [os.path.relpath(ii, start=work_path) for ii in abs_file_list]
@@ -526,18 +527,18 @@ def _get_files(self,
526527
per_nfile = 100
527528
ntar = len(files) // per_nfile + 1
528529
if ntar <= 1:
529-
self.block_checkcall('tar czf %s %s' % (of, " ".join(files)))
530+
self.block_checkcall('tar czfh %s %s' % (of, " ".join(files)))
530531
else:
531532
of_tar = self.submission.submission_hash + '.tar'
532533
for ii in range(ntar):
533534
ff = files[per_nfile * ii : per_nfile * (ii+1)]
534535
if ii == 0:
535536
# tar cf for the first time
536-
self.block_checkcall('tar cf %s %s' % (of_tar, " ".join(ff)))
537+
self.block_checkcall('tar cfh %s %s' % (of_tar, " ".join(ff)))
537538
else:
538539
# append using tar rf
539540
# -r, --append append files to the end of an archive
540-
self.block_checkcall('tar rf %s %s' % (of_tar, " ".join(ff)))
541+
self.block_checkcall('tar rfh %s %s' % (of_tar, " ".join(ff)))
541542
# compress the tar file using gzip, and will get a tar.gz file
542543
# overwrite considering dpgen may stop and restart
543544
# -f, --force force overwrite of output file and compress links

0 commit comments

Comments
 (0)