This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
####### RSYNC AUTO BACKUP TO USB DEVICE V0.5 ########## | |
####### Developed by Carlo Pietrobattista ########### | |
### CONFIG VARS ##################################### | |
LOCK_FILE="/tmp/rsync-usb.pid" # the lock file name | |
MOUNT_DEV="/dev/sdh1" # mount device | |
MOUNT_PATH="/mnt/autobackup-usb" # mount point | |
BACKUP_DIR="/home/*" # backup directory | |
RSYNC_LOG_FILE="/var/log/rsync/usb_backup.log" # rsync log file | |
##################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
hostname, sld, tld, port = 'www', 'integralist', 'co.uk', 80 | |
target = '{}.{}.{}'.format(hostname, sld, tld) | |
# create an ipv4 (AF_INET) socket object using the tcp protocol (SOCK_STREAM) | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
# connect the client | |
# client.connect((target, port)) |