Powershell backup code and database to local and offsite
Enable powershell execution permission
Set-ExecutionPolicy RemoteSigned
# purpose: for backing up wiki code and data # time: 2017-2-15 backup localizations backup dirt = "C:\ xampp\ htdocs\ wiki\ data\ backup\" $today=get-date-format "yyyy-M-d" new-item-path C:\ local_backup-name $today-type directorynew-item-path\ 172.16.3.35\ data backup wiki-name $today-type directorycmd / c "C:\ xampp\ mysql\ bin\ mysqldump.exe-uroot-p123456-- Databases wiki > "$local_backup_dir" wiki "$today" .sql "Copy-Item-Recurse C:\ xampp\ htdocs\ wiki C:\ local_backup\ $today\ Copy-Item-Recurse C:\ xampp\ htdocs\ wiki\ 172.16.3.35\ data backup wiki\ $today\
Add to scheduled task