Change name of backup to one that lists in directory ordered by date

Suggest new features here
Post Reply
KB1B
Posts: 5
Joined: Sun Oct 13, 2019 11:31 pm

Change name of backup to one that lists in directory ordered by date

Post by KB1B »

Hello.

Can you change the date portion of the backups to something like YYYY-mm-dd?
This would result in backup names that sort by date in a directory versus having to hunt for a backup by day number and month names.

In file: /var/www/dashboard/admin/config_backup.php
Line 104: $local_time = $dt->format('d-M-Y');
Change to: $local_time = $dt->format('Y-m-d');

Think about it ...

Thanks.
User avatar
MW0MWZ
Site Admin
Posts: 1254
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: Change name of backup to one that lists in directory ordered by date

Post by MW0MWZ »

I *almost* completely agree, the reason for using "M" and not "m" is to make sure that its understood that this is the month.
International date format can be confusing.

For now at least, I have set it to Y-M-d, yes I know the Months will get out of order and that will mess with your OCD (mine too); but you could always order the folder by date too :) just saying...
Andy

73 de MW0MWZ
http://pistar.uk
AA8M
Posts: 1
Joined: Fri Feb 19, 2021 2:49 pm

Re: Change name of backup to one that lists in directory ordered by date

Post by AA8M »

I would like to upvote KB1B's request please.

I also have been making the change that KB1B mentioned to have the YYYY-MM-DD in the backup file names.

With the change you (Andy) made, now, all I have to change is the 'M' to an 'm' in the config_backup.php file. Thank you for making the change.

Thank you also for developing and maintaining Pi-Star.
User avatar
MW0MWZ
Site Admin
Posts: 1254
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: Change name of backup to one that lists in directory ordered by date

Post by MW0MWZ »

AA8M wrote: Sat Feb 20, 2021 9:44 pm I would like to upvote KB1B's request please.

I also have been making the change that KB1B mentioned to have the YYYY-MM-DD in the backup file names.

With the change you (Andy) made, now, all I have to change is the 'M' to an 'm' in the config_backup.php file. Thank you for making the change.

Thank you also for developing and maintaining Pi-Star.
Yup, and my problem with that is that international date formats are different, and I don't want anyone to get confused by that.
I might swap it to the same format as the dashboard versions, those are just yyyymmdd...
What do you think ?
Andy

73 de MW0MWZ
http://pistar.uk
K2IE
Posts: 104
Joined: Mon Aug 20, 2018 5:24 pm
Contact:

Re: Change name of backup to one that lists in directory ordered by date

Post by K2IE »

yyyymmdd would work just fine in my opinion...

73
Post Reply