Commit e97dea8c authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Correcting redirections

parent 8c271745
...@@ -135,7 +135,7 @@ irods_rollback(){ ...@@ -135,7 +135,7 @@ irods_rollback(){
irods_commit(){ irods_commit(){
KEY=$1 KEY=$1
echo "[$KEY] If previous.tar exists, move it around but keep it safe" echo "[$KEY] If previous.tar exists, move it around but keep it safe"
ils $KEY/previous.tar 2&1>/dev/null && ( ils $KEY/previous.tar >/dev/null 2>&1 && (
imv $KEY/previous.tar $KEY/previous_to_delete.tar imv $KEY/previous.tar $KEY/previous_to_delete.tar
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "[$KEY] Error 003 moving previous.tar around. Corrective action has to be taken manualy" echo "[$KEY] Error 003 moving previous.tar around. Corrective action has to be taken manualy"
...@@ -145,7 +145,7 @@ irods_commit(){ ...@@ -145,7 +145,7 @@ irods_commit(){
) )
echo "[$KEY] If latest.tar exists, move it to previous.tar" echo "[$KEY] If latest.tar exists, move it to previous.tar"
ils $KEY/latest.tar 2&1>/dev/null && ( ils $KEY/latest.tar >/dev/null 2>&1 && (
imv $KEY/latest.tar $KEY/previous.tar imv $KEY/latest.tar $KEY/previous.tar
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "[$KEY] Error 004 moving latest.tar to previous.tar. Corrective action has to be taken manualy" echo "[$KEY] Error 004 moving latest.tar to previous.tar. Corrective action has to be taken manualy"
...@@ -160,7 +160,7 @@ irods_commit(){ ...@@ -160,7 +160,7 @@ irods_commit(){
zabbix_err "${KEY}:Error 005" zabbix_err "${KEY}:Error 005"
return 1 return 1
fi fi
ils $KEY/previous_to_delete.tar 2>/dev/null && irm -f $KEY/previous_to_delete.tar ils $KEY/previous_to_delete.tar >/dev/null 2>&1 && irm -f $KEY/previous_to_delete.tar
} }
# Choose if the data should be processed or skipped # Choose if the data should be processed or skipped
...@@ -196,6 +196,7 @@ pack_and_send() { ...@@ -196,6 +196,7 @@ pack_and_send() {
if [[ $days -ge 0 ]]; then if [[ $days -ge 0 ]]; then
# We have an uptodate dump (newer than snapshot) # We have an uptodate dump (newer than snapshot)
echo "[$KEY] latest.tar is up to date" echo "[$KEY] latest.tar is up to date"
format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S) "-" "-" "Skipped" >> $LOCAL_REPORT
return 0 return 0
fi fi
# find files modified in the last $days. If none, we can skip because latests irods version is up to date. # find files modified in the last $days. If none, we can skip because latests irods version is up to date.
......
Supports Markdown
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