src/Monashee/Backup/UploadS3.php
private function deleteDailyBackups()
    {
        try {
            $date = strtotime('-2 months');

            // leave first day of the month
            if ((int) date('j', $date) !== 1) {
                $this->filesystem->deleteDir(date("Y/m/d", $date));
            }
        } catch (\Exception $e) {
            $this->event->fire('MonasheeBackupError', 'Error trying to delete directory on AWS S3');
        }
    }
private function deleteDailyBackups()
    {
        try {
            $date = strtotime('-2 months');

            // leave first day of the month
            if ((int) date('j', $date) !== 1) {
                $this->filesystem->deleteDir(date("Y/m/d", $date));
            }
        } catch (\Exception $e) {
            $this->event->fire('MonasheeBackupError', 'Error trying to delete directory on AWS S3');
        }
    }
private function deleteDailyBackups ( ) { try { $ date = strtotime ( '-2 months' ) ; // leave first day of the month if ( ( int ) date ( 'j' , $ date ) !== 1 ) { $ this -> filesystem -> deleteDir ( date ( "Y/m/d" , $ date ) ) ; } } catch ( \ Exception $ e ) { $ this -> event -> fire ( 'MonasheeBackupError' , 'Error trying to delete directory on AWS S3' ) ; } }
Delete AWS S3 directory of 2 months ago but keep 1st of the month
Delete AWS S3 directory of 2 months ago but keep 1st of the month