Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8051

Troubleshooting • Re: Script Help - Files Not Copied [SOLVED]

$
0
0
@thagrol, Thanks for the updated script. As it turns out, my original script I believe did work. My issue turned out to be WinSCP and stale data.

I like your code better though, so will use it but did have to make a few changes. This works:

Code:

rm -rf /mnt/usb64/Backup/b3/*mv /mnt/usb64/Backup/b2/* /mnt/usb64/Backup/b3mv /mnt/usb64/Backup/b1/* /mnt/usb64/Backup/b2cp -rf /home/pi/folder2save/* /mnt/usb64/Backup/b1

Sorry but I don't see the advantage of that over mine. About the only difference is that your modification preserves the b? directories but I find it difficult to see why that's a requirement. Especially as mine will cause create times to always reflect the time the backup was made.

Though as I was working off the top of my head your cp may be more appropriate than mine. But then, I'd use rsync instead.

Ultimately, it's your code and your system so do what's best for you.

Statistics: Posted by thagrol — Mon Apr 28, 2025 7:51 pm



Viewing all articles
Browse latest Browse all 8051

Trending Articles