I know that this question is already 4 years old, but I hope that my answer might be useful to others anyway.
I implemented a standardized way to automate the genome retrieval process in R (see biomartr package).
To retrieve all bacterial reference genomes from several database sources one can simply type:
# download all bacterial reference genomes from NCBI RefSeq
biomartr::meta.retrieval(kingdom = "bacteria", db = "refseq", type = "genome")
# download all bacterial reference genomes from NCBI Genbank
biomartr::meta.retrieval(kingdom = "bacteria", db = "genbank", type = "genome")
Alternatively, you can also specify: type = "proteome", type = "CDS" (coding sequence) or type = "gff".
For more details about downloading specific genomes from specific kingdoms or subkingdoms of life please consult the Meta-Genome Retrieval vignette.
Please note that to promote computational reproducibility in genomics and metagenomics studies, biomartr stores log files for each downloaded genome, proteome, or CDS file.
An example log file looks as follows:
File Name: Escherichia_coli_genomic_refseq.fna.gz
Organism Name: Escherichia_coli
Database: NCBI refseq
Download_Date: Wed Feb 15 15:17:50 2017
refseq_category: reference genome
infraspecific_name: strain=K-12 substr. MG1655
submitter: Univ. Wisconsin
I hope this helps.