-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruciax tsm fixes #119
Ruciax tsm fixes #119
Changes from 5 commits
9c57d56
ced1682
d03f445
6708144
458693f
ec21e6a
39fde87
7be4ac3
f5218d8
bd3a428
cf030c7
fc33d5e
f3275a0
1949187
011b892
b21fd0d
a46397e
d1c8c92
892001e
4c30339
1b5911e
dde07c0
f66bb18
5e4e206
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -582,7 +582,7 @@ def copy_tsm(self, datum, destination, method, option_type): | |
logging.info("Path to tsm data: %s", raw_data_tsm) | ||
logging.info("File/Folder for backup: %s", raw_data_filename) | ||
|
||
#Do a simple pretest to analyse the directly what is going to be backuped | ||
#Do a simple pretest to analyse the directory what is going to be backuped up | ||
#continue only if there are files in the directory and no more folders | ||
list_files = [] | ||
list_folders = [] | ||
|
@@ -592,10 +592,20 @@ def copy_tsm(self, datum, destination, method, option_type): | |
for name in dirs: | ||
list_folders.append(name) | ||
|
||
#Sanity check from zero sized files during the upload | ||
# find *.pickles or *log files which are size of zere and delte them before upload | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment says you check if file is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is true. I put this in the comment section to make the purpose clear (*pickle and eventually an empty log file). BTW: I have never seen a zero sized *zip file ever. |
||
for i_file in list_files: | ||
file_size = os.path.getsize( os.path.join( raw_data_location, i_file) ) | ||
if file_size == 0: | ||
logging.info("Delete file {file} with {size} bytes".format(file=i_file, size=file_size)) | ||
os.remove( i_file ) | ||
list_files.remove(i_file) | ||
|
||
#Sanity check if raw data folder contains a subfolder (mostly important for old raw data sets) | ||
if len(list_files) == 0 or len(list_folders) > 0: | ||
logging.info("ERROR: There are %s files in %s", len(list_files), raw_data_path+raw_data_filename) | ||
if len(list_folders) > 0: | ||
looging.info("ERROR: These folders are found in %s:", raw_data_path+raw_data_filename) | ||
logging.info("ERROR: These folders are found in %s:", raw_data_path+raw_data_filename) | ||
for i_folders in list_folders: | ||
logging.info(" <> %s", i_folders) | ||
logging.info("Check the error(s) and start again") | ||
|
@@ -613,8 +623,8 @@ def copy_tsm(self, datum, destination, method, option_type): | |
else: | ||
logging.info("Pre-test of %s counts %s files for tape upload [succcessful]", raw_data_path+raw_data_filename, len(list_files)) | ||
|
||
|
||
#Do a checksum pre-test: | ||
exit() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean to keep this here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No,... Thank you 👍 |
||
#Do a checksum pre-test for double counts: | ||
checksum_pretest_list = [] | ||
for i_file in files: | ||
f_path = os.path.join(raw_data_path, raw_data_filename, i_file) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
"""Handle copying data between sites. | ||
|
||
This is one of the key tasks of 'cax' because it's responsible for moving | ||
data between sites. At present, it just does scp. | ||
tsm_mover.py contains the necessary classes | ||
to upload and download from tape backup and | ||
syncronize it with the runDB. | ||
|
||
Author: Boris Bauermeister | ||
Email: [email protected] | ||
""" | ||
|
||
import datetime | ||
|
@@ -202,23 +205,23 @@ def upload(self, raw_data_location): | |
if i.find("Total number of objects inspected:") >= 0: | ||
tno_dict['tno_inspected'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects backed up:") >= 0: | ||
tno_dict['tno_backedup'] = int(i.split(":")[1]) | ||
tno_dict['tno_backedup'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects updated:") >= 0: | ||
tno_dict['tno_updated'] = int(i.split(":")[1]) | ||
tno_dict['tno_updated'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects rebound:") >= 0: | ||
tno_dict['tno_rebound'] = int(i.split(":")[1]) | ||
tno_dict['tno_rebound'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects deleted:") >= 0: | ||
tno_dict['tno_deleted'] = int(i.split(":")[1]) | ||
tno_dict['tno_deleted'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects expired:") >= 0: | ||
tno_dict['tno_expired'] = int(i.split(":")[1]) | ||
tno_dict['tno_expired'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects failed:") >= 0: | ||
tno_dict['tno_failed'] = int(i.split(":")[1]) | ||
tno_dict['tno_failed'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects encrypted:") >= 0: | ||
tno_dict['tno_encrypted'] = int(i.split(":")[1]) | ||
tno_dict['tno_encrypted'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of objects grew:") >= 0: | ||
tno_dict['tno_grew'] = int(i.split(":")[1]) | ||
tno_dict['tno_grew'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of retries:") >= 0: | ||
tno_dict['tno_retries'] = int(i.split(":")[1]) | ||
tno_dict['tno_retries'] = int(i.split(":")[1].replace(",", "")) | ||
elif i.find("Total number of bytes inspected:") >= 0: | ||
tno_dict['tno_bytes_inspected'] = i.split(":")[1].replace(" ", "") | ||
elif i.find("Total number of bytes transferred:") >= 0: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want to keep the script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course not! Thank you checking.