The program below will do most everything you want. However, it only outputs the last 24 hours data every 24 hours not 48 hours worth of data. (The latter could be done but would involve merging two files which gets complicated due to the headers) It also tries to send the file up to 3 times until successful.
This should work but I have not tried it live. You may get an error the first time you load it as the USR drive it defined within the program to it takes one run before this is set correctly.
I hope this is beneficial to all to see the principles - there are other examples in the CRBasic help.
As I mentioned before this will become a little simpler in the next release of logger operating system although the option to timestamp files, which is already on the wish list, may be a version later.
'Created by Short Cut (2.8)
'Declare Variables and Units
'Define public variables - these are temporary memory locations with names that can be accessed by the program
Public Outstat As Boolean, Sendit As Boolean, SentOK As Boolean, tries 'These variables control the ftp process
Public LastFileName As String * 30 'This is a variable, defined as a string, that will store the name of the last file created by the TableFile instruction
Public Newfilename As String *50 'holds the timestamped destination filename
'Define constants - these are values with names that can be accessed by the program, but cannot be changed
Const ServerIP = "192.168.0.1" 'This is the address of the FTP server that you want to send files to
Const User = "Admin" 'This is the user name needed to login to the FTP server
Const Password = "Admin" 'This is the password needed to login to the FTP server
Const DestPath = "/Site1/Data/Onemin" 'This is the destination directory where the FTP'ed file will be saved on the FTP server
'Define Data Tables
'Every day at 2 am write a file of the last 24 hours data
SetStatus("UsrDriveSize","100000") 'Sets the USR drive size to 100k
'Default Datalogger Battery Voltage measurement BattV
'Generic Differential Voltage measurements PSP1
'Generic Differential Voltage measurements PSP2
'Call Data Tables and Store Data
'The following line sets a second variable the code in the slow sequence can monitor
'Checking Outstat is risky as it will get reset at the next run of the main scan
If Outstat Then
Sendit = true
Newfilename = DestPath & " " & Public.TimeStamp(4,0) 'A quick way of generating a timestamp
Newfilename=Replace(Newfilename,":","") 'Get rid of the colons - not allowed in filenames
Newfilename=Newfilename &".dat" 'add a fixed suffix
SlowSequence 'Just to do the ftp without interferring with measurements.
Scan (1,min,3,0) 'Every minute check.
If Sendit Then
SentOK = FTPClient (ServerIP,User,Password,LastFileName,Newfilename,0)
If SentOK OR tries=3 Then Sendit=false