Showing posts with label windows 2019. Show all posts
Showing posts with label windows 2019. Show all posts

Wednesday, August 23, 2023

Create script backup on windows

Ref : Batch script to make backup folder only new and modified files

----------------Script.bat----------------------------

@echo off


set destination=E:\Backup_Express

set source=D:\Eexpress


for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set yyyymmdd1=%%j.%%i.%%k

xcopy %source%"\*" %destination%"\*" /m/e/y

echo Last Backup Date %yyyymmdd1% >> E:\Backup_Express\Log_backup_express.txt

echo A folder containing the latest date has been created in root directory of %source%.

echo Finished copying %source% to %destination%

echo.

----------------End Script--------------------------- 

Create schedule


 


Tuesday, April 11, 2023

Configure NFS on ubuntu

 configure NFS Link How to Install and Configure an NFS Server on Ubuntu 22.04

#cat /etc/exports

/mnt/DownloadRW 192.168.1.101/24(rw,sync,no_subtree_check)

/mnt/DownloadRO 192.168.1.101/24(ro,sync,no_subtree_check)

Check NFS running

#rpcinfo -p

#service nfs-kernel-server status

#ps aux | grep nfsd

Allow ufw firewall

ufw allow from 192.168.1.0/24 to any port 111

ufw allow from 192.168.1.0/24 to any port 2049

ufw allow from 192.168.1.0/24 to any port 13025

Configure NFS client on Windows server 2019 https://computingforgeeks.com/install-and-configure-nfs-client-on-windows-10-server-2019/



Tuesday, October 18, 2022

Script add manual IP on windows 2019

Check IP Address IPV4
netsh int ip show config

--------------------------------start---------------------------------------- 
@ECHO off
cls
:start
ECHO.
ECHO Type the number below for which action you want to perform:
ECHO.
ECHO 1. Manually Set Static IP Address for Mobile Network
ECHO 2. Manually Set Static IP Address for Home Wifi
ECHO 3. Manually Set Static IP Address for Local Area Connection 3
ECHO 4. Obtain an IP address automatically Mobile Network
ECHO 5. Obtain an IP address automatically Home Wifi
ECHO 6. Obtain an IP address automatically for Local Area Connection 3
ECHO 7. Exit
ECHO.
set choice=
set /p choice=What would you like to do?: 
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto con1
if '%choice%'=='2' goto con2
if '%choice%'=='3' goto con3
if '%choice%'=='4' goto autosearch1
if '%choice%'=='5' goto autosearch2
if '%choice%'=='6' goto autosearch3
if '%choice%'=='7' goto end
ECHO "%choice%" is not valid, try again
ECHO.
goto start
:con1
ECHO Manually setting static IP address for Mobile Network
netsh interface ip set address "Ethernet" static 192.168.219.95 255.255.255.0 192.168.219.58 1
netsh interface ipv4 add dnsserver name="Ethernet" address=192.168.219.100 index=1
netsh interface ipv4 add dnsserver name="Ethernet" address=192.168.219.58 index=2
goto end
:con2
ECHO Manually setting static IP address for Home Wifi
netsh interface ip set address "Ethernet" static 192.168.0.95 255.255.255.0 192.168.0.58 1
netsh interface ipv4 add dnsserver name="Ethernet" address=192.168.0.100 index=1
netsh interface ipv4 add dnsserver name="Ethernet" address=192.168.0.58 index=2
goto end
:con3
ECHO Manually setting static IP address for Local Area Connection 3
netsh interface ip set address "Local Area Connection 3" static 192.168.0.25 255.255.255.0 192.168.0.1 1
goto end
:autosearch1
ECHO Obtaining IP Address automatically for Mobile Network
ipconfig /renew "Ethernet"
goto end
:autosearch2
ECHO Obtaining IP Address automatically for Home Wifi
ipconfig /renew "Ethernet"
goto end
:autosearch3
ECHO Obtaining IP Address automatically for Local Area Connection 3
ipconfig /renew "Local Area Connection 3"
goto end
:bye
ECHO BYE
goto end
-----------------------------------/End/-----------------------------------------

Wednesday, June 29, 2022

how to access samba file share from windows server 2019

 Ref: www.alibabacloud.com

gpedit.msc

After edit not restart Server

Solution

  1. On an on-premises Windows client, press Win+R to open the Run dialog box. In the Run dialog box, enter gpedit.msc in the Open field, and then click OK.

  2. In the left-side navigation pane of the Local Group Policy Editor dialog box, choose Computer Configuration > Administrative templates > Network > Lanman Workstation.

  3. In the Setting section of the Lanman Workstation page, click Enable insecure guest logons.

  4. In the Enable insecure guest logons dialog box, select Enabled. Click Apply.

  5. Mount the SMB share.

  6. If you still fail to mount the SMB share, restart the Windows client to clean up the cache and try again.

Edit share configure on Samba

Change follow the Red highlight 
-------------------------------------------//
[Downloads]
   comment = Triple X
   path = /home/user/Downloads
   guest ok = yes
   read only = no
   writeable = yes
   browseable = yes
   create mask = 0775
   directory mask = 0775
   valid users = user, nobody
//--------------------------------------------

Allow user nobody only Write on folder Software

$ history | grep nobody
id nobody
chown +g nobody Downloads/Software/
chown nobody -R Downloads/Software/
sudo chown nobody -R Downloads/Software/