I think it would be very helpful to order the backup files listed in "bam-backups" alphabetically. Actually I cannot see a specific order and it is somehow difficult to find the latest backup (I have the timestamp as part of the file name). The file timestamp doesn't match the backup time stamp, especially if the codebase is rsync'ed from one location to another or version controlled with git.

In the 6.x and 7.x branch of the module it is only necessary to insert

asort($files);

at line 206 in includes/backup_migrate.drush.inc.

It might also be possible to provide an option to the "bam-backups" command for this. In this case I would provide a patch, off course :)

CommentFileSizeAuthor
#4 sort_backups_by_date-2084905-4.patch833 bytesAnonymous (not verified)
#2 sort_backups_by_date-2084905-2.patch741 bytesAnonymous (not verified)
#1 BAM Drush sort order.png37.77 KBfrank ralf

Comments

frank ralf’s picture

Title: Sort backup files alphabetically in "bam-backups" » Sort order of backup files in "bam-backups"
Version: 7.x-2.x-dev » 7.x-2.7
StatusFileSize
new37.77 KB

Actually, the backups are sorted alphabetically now as requested in the OP (see screenshot).

However, I would prefer a chronological sort order or even better the option to choose between sort orders. I only changed the name of my development site so now the sort order gets jumbled.

BAM Drush sort order.png

Frank

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new741 bytes

Here ist a patch. It works with PHP 5.3.26, but shout be working with any PHP version supported by Drupal 7.

ronan’s picture

Status: Needs review » Needs work

Drupal 7 supports PHP 5.2.5 and it doesn't look like closures are available < 5.3. I can commit this if you want to rewrite it to not use the anonymous function.

Thanks
Ronan

Anonymous’s picture

Issue summary: View changes
StatusFileSize
new833 bytes

I provided a new patch and replaced the anonymous function by helper function.

couturier’s picture

Version: 7.x-2.7 » 8.x-4.x-dev
Status: Needs work » Postponed (maintainer needs more info)

There has been discussion of moving the best feature requests to the 8.x-4.x-dev branch since that is where most of the work is taking place going forward.

It is unclear whether ronan already committed this to the 7.x branch. Can anyone confirm?

couturier’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

It looks like this has just been done here: Ability to order the Saved Backups by Name, Date and Size