Get the App
SLTechnology News&Howtos  ›  Servers  › 

Automatically back up websites and databases, package and upload FTP servers and delete files in the first 30 days

Shulou Source: shulou.com Published: 2022-06-02 18:22:06 10月02日 Update

Automatic backup of websites and databases Package and upload FTP servers and delete files from the first 30 days

@echo offnul

Set nowdate=%date:~0,10%

set nowdate=%nowdate:/=%

Md d:\autobak\"%nowdate:/=-%"\www

Md d:\autobak\"%nowdate:/=-%"\data

forfiles /p d:\autobak /d -30 /c "cmd /c del /f /q /a @path && rd /s /q @path"

xcopy d:\www d:\autobak\"%nowdate:/=-%"\www

xcopy d:\data d:\autobak\"%nowdate:/=-%"\data

cd c:\Program Files\WinRAR\

winrar.exe a -r d:\autobak\"%nowdate:/=-%".zip d:\autobak\"%nowdate:/=-%"\

Echo open 61.136.208.30 >ftp.up

Echo user >>ftp.up

Echo password >>ftp.up

Echo cd neibu-www\ >>ftp.up

Echo lcd D:\autobak>>ftp.up

Echo put "%nowdate:/=-%".zip >>ftp.up

Echo bye>>ftp.up

FTP -s:ftp.up

del ftp.up /q

pause & exit

Tags: Backup data database file server website service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno vpn Shulou Tech Info MariaDB Microsoft