commit message from python script
This commit is contained in:
@@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
import os, time
|
import os, time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def check_ping(hostname = str):
|
||||||
|
response = os.system("ping -c 1 " + hostname)
|
||||||
|
# and then check the response...
|
||||||
|
if response == 0:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def rclone_folders_copy(folder_to_sync=list, dest_folder = str):
|
def rclone_folders_copy(folder_to_sync=list, dest_folder = str):
|
||||||
check_list = []
|
check_list = []
|
||||||
for sync_folder in folder_to_sync:
|
for sync_folder in folder_to_sync:
|
||||||
@@ -28,6 +39,13 @@ def rclone_folders_copy(folder_to_sync=list, dest_folder = str):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
folder_to_sync_manuell = ['ssh_keys', 'frei', 'Doku','Joplin', 'Hack']
|
folder_to_sync_manuell = ['ssh_keys', 'frei', 'Doku','Joplin', 'Hack']
|
||||||
|
print("Check online status")
|
||||||
|
for check_count in range(1,10):
|
||||||
|
print(check_count)
|
||||||
|
# if check_ping(hostname="schlaubistechtalk.de") is True:
|
||||||
|
# break
|
||||||
|
print("Lauf", check_count, "warte 10 Sekunden..",sep=" ")
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
if rclone_folders_copy(folder_to_sync=folder_to_sync_manuell, dest_folder="/home/jonnybravo/.nextcloud") is True:
|
if rclone_folders_copy(folder_to_sync=folder_to_sync_manuell, dest_folder="/home/jonnybravo/.nextcloud") is True:
|
||||||
print("Sync erfolgreich")
|
print("Sync erfolgreich")
|
||||||
|
|||||||
Reference in New Issue
Block a user