Initial creation.
This commit is contained in:
parent
cd3f7a80a4
commit
b28e78ee1a
41
backup.sh
41
backup.sh
@ -1,23 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Check if the required parameters are provided
|
####################################
|
||||||
if [ "$#" -ne 2 ]; then
|
#
|
||||||
echo "Usage: $0 <source_folder> <destination_folder>"
|
# Backup script
|
||||||
exit 1
|
#
|
||||||
fi
|
####################################
|
||||||
|
|
||||||
# Source and destination folders
|
# Where to backup to
|
||||||
source_folder="$1"
|
dest="/home/john/backup"
|
||||||
destination_folder="$2"
|
|
||||||
|
|
||||||
# Extract the last folder of the source path
|
# Log File
|
||||||
source_folder_name=$(basename "$source_folder")
|
log=$dest/backup.log
|
||||||
|
|
||||||
# Log file path based on the specified format
|
# Backup beginning
|
||||||
log_file="/var/log/backup-${source_folder_name}.log"
|
echo "Starting backup: $(date)" > "$log"
|
||||||
|
echo "Backup destination: $dest" >> "$log"
|
||||||
|
|
||||||
# Run rsync with the appropriate options and log the output
|
# Execute home backup
|
||||||
rsync -av --delete "$source_folder/" "$destination_folder/" >> "$log_file" 2>&1
|
mkdir -p $dest/home/john/
|
||||||
|
echo "Backing up /home to $dest" >> "$log"
|
||||||
|
rsync -rvz --delete-during --exclude={'lost+found','nas/*','backup/*','downloads/*','.local/share/Steam/steamapps/common/*'} /home/ $dest/home/ >> "$log"
|
||||||
|
echo "Home backup finished: $(date)" >> "$log"
|
||||||
|
|
||||||
# Log completion message
|
# Execute etc backup
|
||||||
echo "Backup completed on $(date)" >> "$log_file"
|
#mkdir -p $dest/etc
|
||||||
|
#echo "Backing up /etc/ to $dest/etc/" >> "$log"
|
||||||
|
#rsync -av --delete-during /etc/ $dest/etc/ >> "$log"
|
||||||
|
#echo "Etc backup finished: $(date)" >> "$log"
|
||||||
|
|
||||||
|
# Backup finished
|
||||||
|
echo "Backup finished: $(date)" >> "$log"
|
||||||
|
|||||||
15
findMTU.sh
Executable file
15
findMTU.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
destination_ip="$1"
|
||||||
|
|
||||||
|
# Set initial packet size
|
||||||
|
packet_size=1200
|
||||||
|
|
||||||
|
# Loop to find the maximum MTU size
|
||||||
|
while true; do
|
||||||
|
ping -4 -M do -c 1 -s $packet_size $destination_ip > /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Maximum MTU size: $((packet_size + 28 - 2))"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
packet_size=$((packet_size + 2))
|
||||||
|
done
|
||||||
1
firewallQuietFans.sh
Executable file
1
firewallQuietFans.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
ipmitool -I lan -U ADMIN -H 192.168.0.125 sensor thresh FANA lower 150 225 300
|
||||||
3
r720QuietFans.sh
Executable file
3
r720QuietFans.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
ipmitool -I lanplus -H 192.168.0.67 -U root -P $1 raw 0x30 0x30 0x01 0x00
|
||||||
|
# 20% ipmitool -I lanplus -H 192.168.0.67 -U root -P $1 raw 0x30 0x30 0x02 0xff 0x14
|
||||||
|
#ipmitool -I lanplus -H 192.168.0.67 -U root -P $1 raw 0x30 0x30 0x02 0xff 0x0a
|
||||||
3
x10sllQuietFans.sh
Executable file
3
x10sllQuietFans.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
ipmitool -I lanplus -H 192.168.0.28 -U ADMIN -P ADMIN sensor thresh FAN3 lower 0 100 200
|
||||||
|
# 20% ipmitool -I lanplus -H 192.168.0.67 -U root -P $1 raw 0x30 0x30 0x02 0xff 0x14
|
||||||
|
#ipmitool -I lanplus -H 192.168.0.67 -U root -P $1 raw 0x30 0x30 0x02 0xff 0x0a
|
||||||
Loading…
x
Reference in New Issue
Block a user