SheffieldMLtracking / btcontrol

A tool for controlling multiple tracking systems, rsyncing the data off them, etc.
GNU General Public License v3.0
0 stars 0 forks source link

Let it only sync subsets, such as: btcontrol --rsync 2024-10-04/SESSION/SET #3

Open lionfish0 opened 4 hours ago

lionfish0 commented 4 hours ago

1) Using btcontrol --rsync 2024-10-04 or btcontrol --rsync 2024-10-04/SESSION works great for syncing specific data.

Using btcontrol --rsync 2024-10-04/SESSION/SET will sync a specific set BUT only if you have already synced other sets from that session. If there is no folder for the session at the destination, you just get an error and nothing copies.

I guess this is because btcontrol appends the DATE/SESSION/SET inputs to the stored source and destination directories before calling rsync, and rsync won't copy to a destination that doesn't already exist. Now that I think about it, I expect btcontrol --rsync 2024-10-04/SESSION would also fail if the date folder hadn't already been created, I just didn't test that. Can we get around this problem by using mkdir to create the nested folder structure for the destination if it doesn't already exist, before we call rsync?