2
1
I have a script on a Pi3 that creates files in:
home/pi/data/*csv
I am trying to write a bash script that uses PuTTY to copy and erase those files into a folder on my computer.
This is what I have so far:
@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%"
set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
set "data='C:\Users\Recorded Data\%fullstamp%'"
echo Making Directory at: %data%
md %data%
cd C:\Programfiles
pscp @pi:/home/pi/data/*.csv %data%
pause
I saw that I have to use PSFTP to delete the files, but I also need to add a script to log into the pi? I'm just kinda lost right now.