(Older Mac users will remember QuicKeys was the premier macro application choice from the late 1980s through the 2000s Keyboard Maestro took up its mantle under OS X and has persisted to the present. While not always classed as programming, macros are not very far off, either. The key elements for a good macro system are that it’s easy to create and modify macros, that they execute consistently, and that they require only understanding the notion that things occur in order–no coding experience is required. Keyboard Maestro lets you create macros, a computer-science term dating from the late 1950s, which covers a series of grouped actions performed in sequence. Its latest update, version 10, shipped in November 2021 with dozens of new features large and small. Keyboard Maestro has occupied a big swath of that niche since 2002. Yet the insistence of operating systems and apps on making us carry out mind- and finger-numbing jobs has given rise to a varied category of utilities that automate operations. # Archive source file to backup with the source file last mod time attached to name.Ĭopy/rename source_file_full_path/source_file_name to backup_file_full_path/source_file_name renamed to backup_file_full_path/source_file_name.Price comparison from over 24,000 stores worldwideĬomputers should perform repetitive actions on our behalf, freeing us for higher-level work. Repeat, until enough disk space is cleared. Repeat until there is enough free space.ĭelete the oldest file that contains source_file_name Delete oldest backup if not enough disk space. If backup_age < min_backup_age, stop the script. Last_backup_mod_time = the last modification time of backup_file_full_path (the newest file found in that folder that contains source_file_name)īackup_age = source_file_mod_time - last_backup_mod_time # Guard clause against a minimum backup age. Send notification to user: "Not enough free space on USB to backup source_file_full_path."Ĭreate the folders to the path backup path.Ĭall # Archive source file to backup with the source file last mod time attached to name. # Guard clause against not enough disk space: If any file at backup_file_full_path != contain source_file_name: # Guard clause against no backups folder or older backups existing. Source_file_mod_time = source_file_full_path/source_file_name modification time. # Assign source file modification time to variable: Source_file_size = source_file_full_path/source_file_name file size Usb_free_space = the amount of free space on last_usb_drive_name # Assign free space on backup drive to variable: If last_usb_drive_name != contain backup_drive_tag, stop the scriptīackup_file_full_path = source_file_full_path with source_file_drive replaced by last_usb_drive_name Last_usb_drive_name = drive name of the usb that was plugged in. Min_backup_age: The minimum time difference between source of truth file & last backup: Source_file_full_path: The full path to the source file.īackup_drive_tag: The backup USB tag: If the tag is contained within the USB drive name, backup the source file. Source_file_name: The name of the source file to be backed up. Source_file_drive_name: The drive that contains the source file. Keep backups tagged with the source file modification time. Once the USB is full, delete the oldest archive and replace it with the newest. Purpose: Keep an archived backup of a file (the source of truth file) on an external USB. The shortcuts dont make sense and require me to rebind almost everything manually with Keyboard Maestro or other apps. What’s the best existing tools to get the functionality the simplest? Bash shell script: For what it’s worth, this is the logic I mapped out. Before reading these last comments I wrote out the logic I need, and was about to venture to make my first bash shell script to do the job.īut, likely there is a better way with existing tools. I think I’m trying to reinvent the wheel. Some way to assign file modification times to variables and run logic against them. ~]$ gdbus call -e -d -o /org/freedesktop/Notifications -m MyApp 0 IconAlert "Watch Out!" "Something odd is going on, please stay vigilant and pay attention!" '' '' 0 Some kind of way to send notifications to the user. acpid - non-keyboard event handler (special keys such as volume, Fn keys, brightness, killswitches).systemd will be good enough, can trigger services on device events, socket connection events, timer events, other services state changes.Some kind of background daemon to watch for the trigger event. Pattern match storage device name to contain a string. Trigger event: When a new USB or storage device is plugged in.
0 Comments
Leave a Reply. |