Hi Guys,
Hope somebody can help, this has been bugging me for two days now.
ive searched through the posts concerning but each one gets me a little more confused.
I simply want to download a cpanel backup automatically to my home pc every day,
so far I have the script below which downloads everything in the backups folder but I want to just download the accounts folder.
My problem is one of the folder names changes to the current date every day.
ie:
/backup/2015-04-16/accounts
so the date part changes to the next day every day, and its just the accounts folder I want to download.
I believe this is what I need:
$stamp = $(Get-Date -f "yyyyMMdd")
but I cant get it to work what ever I do.
any ideas what I need to do would be appreciated, thank you.
option batch abort
option confirm off
open sftp://USERNAME:PASSWORD@0.0.0.0:34567
cd /backup
option transfer binary
get *.* C:\Users\homepc\Desktop\FTP-site-backups\
close