Copy file permissions over in rsync
If the file permissions got out of sync on the roborio, then rsync
didn't fix it.
This came up when the roborio crashed in middle of a deploy and messed
up the file permissions somehow.
Change-Id: Ib8ca816a0f3982416adb569c217836900c0701a8
diff --git a/frc971/downloader/downloader.py b/frc971/downloader/downloader.py
index 42d4a7c..fa618fe 100644
--- a/frc971/downloader/downloader.py
+++ b/frc971/downloader/downloader.py
@@ -72,9 +72,9 @@
if user is None:
if args.type == "pi":
- user = "pi"
+ user = "pi"
elif args.type == "roborio":
- user = "admin"
+ user = "admin"
target_dir = "/home/" + user + "/robot_code"
ssh_target = "%s@%s" % (user, hostname)
@@ -86,7 +86,7 @@
rsync_cmd = ([
"external/rsync/usr/bin/rsync", "-e", ssh_path, "-c", "-v", "-z",
- "--copy-links"
+ "--perms", "--copy-links"
] + srcs + ["%s:%s/%s" % (ssh_target, target_dir, relative_dir)])
try:
subprocess.check_call(rsync_cmd)