diff --git a/backup.sh b/backup.sh index b32cb5f..0092c64 100644 --- a/backup.sh +++ b/backup.sh @@ -1,23 +1,32 @@ #!/bin/bash -# Check if the required parameters are provided -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " - exit 1 -fi +#################################### +# +# Backup script +# +#################################### -# Source and destination folders -source_folder="$1" -destination_folder="$2" +# Where to backup to +dest="/home/john/backup" -# Extract the last folder of the source path -source_folder_name=$(basename "$source_folder") +# Log File +log=$dest/backup.log -# Log file path based on the specified format -log_file="/var/log/backup-${source_folder_name}.log" +# Backup beginning +echo "Starting backup: $(date)" > "$log" +echo "Backup destination: $dest" >> "$log" -# Run rsync with the appropriate options and log the output -rsync -av --delete "$source_folder/" "$destination_folder/" >> "$log_file" 2>&1 +# Execute home backup +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 -echo "Backup completed on $(date)" >> "$log_file" +# Execute etc backup +#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" diff --git a/findMTU.sh b/findMTU.sh new file mode 100755 index 0000000..e7dc64a --- /dev/null +++ b/findMTU.sh @@ -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 diff --git a/firewallQuietFans.sh b/firewallQuietFans.sh new file mode 100755 index 0000000..3d10e06 --- /dev/null +++ b/firewallQuietFans.sh @@ -0,0 +1 @@ +ipmitool -I lan -U ADMIN -H 192.168.0.125 sensor thresh FANA lower 150 225 300 diff --git a/r720QuietFans.sh b/r720QuietFans.sh new file mode 100755 index 0000000..eb6ccc3 --- /dev/null +++ b/r720QuietFans.sh @@ -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 diff --git a/x10sllQuietFans.sh b/x10sllQuietFans.sh new file mode 100755 index 0000000..30e06c7 --- /dev/null +++ b/x10sllQuietFans.sh @@ -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