occasionally I run a backup of my phpbb forum files from the Shell command line:

zip -r forum_backup  ~/public_html/forum/*

I'd like to add date elements to the file name, so that the zip file created is automatically formed as

    forum_backup_05182013.zip

or something similar

Thanks

Hi!

Try using the date command to generate the date for the filename. Something like this should work:

zip -r forum_backup_$(date +%Y%m%d) ~/public_html/forum/*

I took some liberty with the date format there. If you put the date first, then the month and day, it sorts nicely. You can re-arrange them if you want.

I hope this helps!
-G

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.