Command toolbox

Create remote backup from mysql database on windows using bat file

backup.bat
@echo off
d:
cd /d %0\..
for /f "tokens=1* delims= " %%a in ('date/t') do set yyyy-mm-dd=%%a
for /f "tokens=1* delims=-" %%a in ('echo %yyyy-mm-dd%') do set year=%%a
for /f "tokens=2* delims=-" %%a in ('echo %yyyy-mm-dd%') do set month=%%a
for /f "tokens=3* delims=-" %%a in ('echo %yyyy-mm-dd%') do set day=%%a
for /f "tokens=1* delims=:" %%a in ('echo %time%') do set hour=%%a
for /f "tokens=2* delims=:" %%a in ('echo %time%') do set mins=%%a
for /f "tokens=3* delims=:" %%a in ('echo %time%') do set sec=%%a
for /f "tokens=1* delims= " %%a in ('echo %sec%') do set secs=%%a
set cdate=%year%_%month%%day%_%hour%%mins%
@echo on
mysqldump.exe -C -v -h domain.com -u xxxxxxxxx --password=xxxxxxxx baza46_mauto | gzip -v -9 > backup_%cdate%.sql.gz

Also needed in same folder:
- gzip.exe - mysqldump.exe

Enable HEVC on Windos 1/11

ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq
or
start ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq

NFS share on windows 10

Install the NFS Client

Go to Control Panel > Programs and Features > Turn Windows Features on or off +
Enable “Services for NFS” with both subcategories +

Enable Write Permission for the Anonymous User

Go to Regedit > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default Create a new New DWORD (32-bit) Value inside the Default folder named AnonymousUid and assign the UID found on the UNIX directory as shared by the NFS system (Default: 0) Create a new New DWORD (32-bit) Value inside the Default folder named AnonymousGid and assign the GID found on the UNIX directory as shared by the NFS system (Default: 0) Restart the PC to apply the changes

Mount the NFS Share

Open command prompt and enter the command below:

mount -o anon <ip_address>:/mnt/location Z:

  • -o anon sets the user to anonymous

  • <ip_address>/mnt/location is the path to the NFS share on the NFS server

  • Z: is the drive that the NFS share will be mounted to on the Windows system

Open the Startup folder by opening the Run tool and entering shell:startup
Create a nfsmount.bat file in that directory with the mount command used above.
This file will be read on startup and will automatically mount the NFS Share.