-
Notifications
You must be signed in to change notification settings - Fork 235
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
Copy all run and out dirs at once, not in for-loop #3025
Changes from 52 commits
1d719d5
f3b79bf
ed1d334
3795f0c
693e981
41df050
5a8f90c
132997f
e57dd5d
5678889
4286732
c8b9240
7427d16
abbc021
67905b8
61b50c0
f45f38e
b8331a4
b73c2f5
f6ba486
d02858e
17346d9
a0baba2
01ac887
78db328
714a698
4bfb1c3
3b8a52c
725b991
dc4a577
e59188d
44a1b0b
a02c00b
f397c40
b64eb80
3380b97
3d4ab9f
6fa5063
0d20cc1
d4b3df2
ff1e4af
1afd382
f6f1e34
93f7155
780b9f1
76d825b
f7d1d0f
e4289c3
9141d3b
c8cda6e
61dd672
2b1a3ed
35eb512
bdf2095
aeb0bc0
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 |
---|---|---|
|
@@ -45,5 +45,37 @@ remote.copy.from <- function(host, src, dst, options = NULL, delete = FALSE, std | |
} | ||
} | ||
PEcAn.logger::logger.debug("rsync", shQuote(args)) | ||
system2("rsync", shQuote(args), stdout = TRUE, stderr = as.logical(stderr)) | ||
out <- | ||
system2("rsync", args, stdout = "", stderr = as.logical(stderr)) | ||
|
||
# Informative errors from rsync man page | ||
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. I appreciate the desire for clarity, but I'd rather send people to the rsync docs for these error messages. We use whatever rsync version is installed on the host system, so hard-coding values here feels like an invitation for them to get out of sync. I assume rsync doesn't often change the meaning of exit codes between versions, but if they add a new code that's not on this list then this switch will return an empty string instead of the numeric value. 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. Yeah, this makes sense. I'm going to keep errors (anything other than 0) as |
||
msg <- | ||
switch( | ||
as.character(out), | ||
'0' = "Success", | ||
'1' = "Syntax or usage error", | ||
'2' = "Protocol incompatibility", | ||
'3' = "Errors selecting input/output files, dirs", | ||
'4' = "Requested action not supported", | ||
'5' = "Error starting client-server protocol", | ||
'6' = "Daemon unable to append to log-file", | ||
'10' = "Error in socket I/O", | ||
'11' = "Error in file I/O", | ||
'12' = "Error in rsync protocol data stream", | ||
'13' = "Errors with program diagnostics", | ||
'14' = "Error in IPC code", | ||
'20' = "Received SIGUSR1 or SIGINT", | ||
'21' = "Some error returned by waitpid()", | ||
'22' = "Error allocating core memory buffers", | ||
'23' = "Partial transfer due to error", | ||
'24' = "Partial transfer due to vanished source files", | ||
'25' = "The --max-delete limit stopped deletions", | ||
'30' = "Timeout in data send/receive", | ||
'35' = "Timeout waiting for daemon connection" | ||
) | ||
if (out != 0) { | ||
PEcAn.logger::logger.severe(paste0("rsync status: ", msg)) | ||
} else { | ||
PEcAn.logger::logger.info(paste0("rsync status: ", msg)) | ||
} | ||
} # remote.copy.from |
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.
is removing the
shQuote
aroundargs
intentional?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.
Yes, it was intentional, but now that you bring it up I'm not sure it's correct.
system2()
alwaysshQuote
scommand
, but I guess it doesn't do that forargs
. I'll add it back and make sure everything still works.