Just a quick one... I need a quick command which will just give me the filename of the most-recently-modified file in a directory.
All I need to do is backup the data in my database in to a file with the current data/time in the name, then reload it.
Here's what I've got so far:
mysqldump -t -c -u username -p database > data/backups/`date +%Y%m%d-%H%M%S`.sql
All I need now is this bit:
mysql -u username -p database < data/backups/`latest_file`.sql