Designing Infrastructure Architecture
Example Prompt:
Example Response:
Related Tasks:
Setting Up Monitoring Tools
Example Prompt:
Example Response:
Related Tasks:
Diagnosing System Issues
Example Prompt:
Example Response:
Related Tasks:
Scripting for Automation
Example Prompt:
Example Response:
import os
import shutil
import datetime
# Define the directories to back up and the backup destination
define source_dirs = ['/path/to/your/data1', '/path/to/your/data2']
backup_dir = '/path/to/your/backup'
# Create a timestamp for the backup folder
timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
backup_folder = os.path.join(backup_dir, f'backup_{timestamp}')
# Create the backup directory if it doesn't exist
if not os.path.exists(backup_folder):
os.makedirs(backup_folder)
# Function to perform the backup
for source in source_dirs:
if os.path.exists(source):
# Get the name of the source directory
dir_name = os.path.basename(source)
# Create a backup of the source directory
shutil.copytree(source, os.path.join(backup_folder, dir_name))
print(f'Backup of {source} completed successfully.')
else:
print(f'Source directory {source} does not exist.')
print('All backups completed.')
Related Tasks:
Creating Technical Documentation
Example Prompt:
Example Response:
Related Tasks: