Capturing and sending of vmstat output everyday

I need to capture the vmstat output of a server every 5 minutes, in a text filename with the name in the format vmoutput. yesterday's date.txt. I need to get the vmstat o/p for the whole day with 5 minutes interval and send it (preferably ftp) to my local desktop folder.

eg: vmstat 300 >vmoutput.$yesterdaydate.txt
ftp <local desktop ip>/<folder>

any ideas ??

one idea:

  1. write a shell script to run vmstat command and append its output to a text file
  2. run this script every 5 minutes using cron
  3. write another script that copies the output file (using ftp) to your desktop folder and then clean the output file - cp /dev/null output_file
  4. run this script using cron everyday at midnight