Sorry I cant include all rclone details at this stage as I have shut the system down to minimise risk of further damage preventing recovery of the deleted files.
I have a folder on my Pi (normally the source) synced to a folder on onedrive (destination), I havent synced for a couple of weeks and today I messed up the command with the source and destinations swapped - so rclone has synced in the wrong direction and deleted a whole lot of recent files on the Pi.
So the command was something like this: rclone sync -v Onedrive:data /home/pi/data
Im pretty naive with linux so I initially assumed any deleted files would just end up in the Pi trash folder like any file I manually delete, but they dont seem to. Should they? Do they go somewhere else or are they permanently deleted?
Thankfully I have a backup from about 2 weeks ago so not the end of the world, but there are one or 2 recent files I didnt really want to lose. I can try a recovery tool on the SD card if there is no native way to recover these files, but thought it was worth asking here first.
Permanently and instantly deleted. The same like anything else deleted from command line. Pi trash is only functionality of its GUI file explorer app.
Good lesson to implement proper 3-2-1 backup strategy:) Mistakes and hardware problems are fact of life. Nobody is immune.
In addition my recommendation is to switch to BTRFS filesystem and utilise snapshots. I do this on my raspberries and run btrbk hourly. In situation like this you could be up and running in less than a minute with home directory restored. Here you are good how to.
@kapitainsky thanks for your quick response. That at least confirms my way forward.
That is what I was trying to automate with rclone, but #1 wiped out #3 My brain is just too old and stuck in its ways so Linux has been quite a learning curve, I think I will stick with drag and drop to a usb stick for now.
That does look like a nice option for many use cases, in this case it is a 3rd party industrial control system that I dont have a good understanding of, so I was trying to be as least invasive as poss.