Creating variable text file name with with sdFat.h

I use DHT22 temperature and humidity sensor and all readings has to be saved on SD card module but the problem that the Arduino stops writing on the SD card after few hours and this is not reliable because I want to take readings for more than a week, so how can I make variable text file name with a counter, the counter will be used to create a new text file after certain number of iterations, I will post the code I use in below, I hope someone can find a solution for this issue, thanks in advance.

#include <DHT.h>;

//////////////////////
#include <SdFat.h> //for the SD card module
#include <SPI.h> //for the SD card module
/////////////////

//Constants
#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino
int counter=0;
/////////////
int chipSelect = 4; //chipSelect pin for the SD card Reader
SdFile mySensorData;
SdFat sd;



//////////////////////

//Variables



int dataCounter;

//////////////////////



float hum;  //Stores humidity value
float temp; //Stores temperature value

void setup()
{

Serial.begin(9600);

dht.begin();
pinMode(10, OUTPUT); //Must declare 10 an output and reserve it
sd.begin(4); //Initialize the SD card reader 


mySensorData.open("DATA.txt", FILE_WRITE);
  if (! mySensorData) {
    Serial.println("error opening DATA.txt");
   } else {
      Serial.println("intialized");
    }

}


////////////////////////////////////////////////////////////////////////

void loop()
{
   
mySensorData.open("DATA.txt", FILE_WRITE);

if (mySensorData) {
 hum = dht.readHumidity();
 temp= dht.readTemperature();

mySensorData.print(hum);      
mySensorData.print("\t"); 

mySensorData.print(temp);      
mySensorData.println(""); 

}
  
mySensorData.close();

delay (1000);

dataCounter=dataCounter+1;  //// I want to start a new text file when the counter reaches 21600 iteration which corresponds to 6 hrs. of working

}

See Create variable text file name to be saved on SD Card