X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=scripts%2Ffiles-from-date.rb;fp=scripts%2Ffiles-from-date.rb;h=4fde0c5b683acfb20c6cef180fe3b87238d57e24;hb=cbfcd06cb32cc5c35bfb8ddb499cb952024068a4;hp=0000000000000000000000000000000000000000;hpb=5bb8f6ee3cb685dda402115e11d05ce6cea39dea;p=backups%2F.git diff --git a/scripts/files-from-date.rb b/scripts/files-from-date.rb new file mode 100755 index 0000000..4fde0c5 --- /dev/null +++ b/scripts/files-from-date.rb @@ -0,0 +1,15 @@ +#!/usr/bin/ruby + +# Make sure the record separator is zero rather than new-line +$/ = "\0" + +# The only argument is the date for which to list files +date = ARGV.shift.to_i + +ARGF.each do |line| + # The seventh and eigth fields are the backup date and the file name. + backupdate,name = line.split( ' ', 8 )[6,7] + + # Print the name if the backup date matches + print name if date == backupdate.to_i +end