#!/usr/bin/perl ###################################################################### # # Apollias_Drag_and_Drop_Pondizer__Separate_Config_File-v1_0.pl # # Version 1.0 # # http://astroblahhh.com/ # # # "Pondize" is a verb I coined which simply means to back up files or folders # to a folder named "Pond". # # On my computer, I like to give my computer folders picturesque, aesthetically # pleasing names which aren't always obviously connected to their actual # purpose. The "Pond" folder is where I like to keep many of my newly-minted # backups. So, anything that goes in the Pond, I say it's been "pondized". $should_zip_or_pondize="zip"; # zip|pondize|no # # Zip means, the script will put all the files dragged/dropped onto # this script into a zip file in the pond. # # Pondize means, the script will copy the files into a folder in # the pond. # # The zip file's name or that folder's name will consist of an # optional prefix, an optional list of files/folders zipped or # pondized (which will probably be abbreviated if you put a lot # of files, or if $max_length_of_pondize_destination_name is # short), the date/time this script was run, and an optional # suffix. # # The "no" option is so you can temporarily configure this # script to not do anything. $full_path_to_pond = "/root/00-ApWorkspace/Pond/"; $should_pondize_to_temp_location_then_copy_to_actual_pond=true; # If true, the script pondizes stuff to the path you provided in # $temp_location_for_pondized_file, and when it's finished # pondizing everything, it copies the pondized item(s) to the # actual, non-temporary pond - the path you provided in # $full_path_to_pond. # # If false, the script doesn't do anything with # $temp_location_for_pondized_file and pondizes things directly # to $full_path_to_pond. # # By the way, nothing is done to delete files from the temp # location after the script is done. $temp_location_for_pondized_stuff="/root/00-ApWorkspace/temp-pond"; # I like to use a temporary location in Puppy's RAM disk, such as: # # /root/00-ApWorkspace/temp-pond # # That way, the script doesn't write anything to my physical # disk drive until the pondized files are all in one place, # or the zip file is completely built. # # That's particularly useful with a Flash drive, because Flash # drives can only be used for a limited number of writes, # so it's good to minimize the number of writes you do. # # A quote from http://en.wikipedia.org/wiki/USB_flash_drive#Longevity - # # "Barring physical destruction of the drive, the memory # or USB connector of a flash drive will eventually fail. SLC # based memory is good for around 100,000 writes; more commonly # used MLC for around 10,000." # # If you have a Flash drive, though, I assume probably writing a # single zip file is better than pondizing multiple loose, # unzipped files. $should_accept_drag_and_drop_items = true; # true|false # # If false, will abort if drag/dropped items are detected. # # If true, will pondize or zip the drag/dropped items. @things_to_pondize_if_script_is_run_without_drag_and_drop = ( "/root/00-ApWorkspace/example nonexistent file" ); $should_halt_script_if_any_things_to_pondize_dont_exist=true; # If true, the script will halt if it finds any of the items in # @things_to_pondize don't exist. # # If false, the script will just go ahead and pondize stuff # without the missing items, and tell you afterward what was # missing. $should_be_capable_of_running_without_drag_and_drop = true; # true|false # # If false, will abort if this script is run without arguments. # # If true, will try to pondize or zip the items in this array: # # @things_to_pondize_if_script_is_run_without_drag_and_drop $should_use_full_paths=false; # true|false # # If true, then, pondizes the full path to files instead of just # the file itself. # # So, if you pondize a file located at "/mnt/truecrypt1/ExampleFile.txt", # the resultant zip file or dated pond folder will contain ExampleFile.txt # inside the folders "mnt" and "truecrypt1", which you'll have to # open to get to ExampleFile.txt. # # # If false, then, if you pondize "/mnt/truecrypt1/ExampleFile.txt", # it doesn't bother with the parent folders, and just saves # "ExampleFile.txt" to the zip file or dated pond folder. # # If false, and you try to pondize two different files with the same # name but at different locations, such as # "/mnt/truecrypt1/ExampleFile.txt" and "/mnt/truecrypt2/ExampleFile.txt", # then... well, unlike the old zip backup script, there's now some # not-very-thoroughly tested code to make the script try to avoid # overwriting files/folders with the same name. # # Again, though, that's not very thoroughly tested at all, so # please be careful. $should_put_am_or_pm_in_time=true; # true|false # # The times will still be in 24-hour format regardless. $prefix_for_pondize_destination_name="Default Prefix"; # A default prefix for the zip file or pondize folder. # # Won't be used if you have the script ask you for a prefix. $should_ask_for_a_pondize_destination_name_prefix=true; # true|false # If true, will prompt the user for a prefix before proceeding. $suffix_for_pondize_destination_name="Default Suffix"; # A default suffix for the zip file or pondize folder. # # Won't be used if you have the script ask you for a suffix. $should_ask_for_a_pondize_destination_name_suffix=true; # true|false # If true, will prompt the user for a suffix before proceeding. $should_add_file_or_folder_names_to_pondize_destination_name=true; # true|false # # The above setting won't be used if you have the script ask # whether or not to do this. $should_ask_if_should_add_file_or_folder_names_to_pondize_destination_name=true; # true|false # # If true, will ask. # # If false, will just use the setting in: # $should_add_file_or_folder_names_to_pondize_destination_name $max_length_of_pondize_destination_name=200; $should_autoclose_at_end_of_script=false; # If true, will wait x seconds (configured below) and then # automatically close the RXVT window. # # If false, won't close the window until the user presses Enter. $num_of_seconds_before_autoclose=5; # Autoclose can happen at the end of the script, if # $should_autoclose_at_end_of_script is set to true. $file_manager_shell_command_to_use="rox"; $open_pond_folder_when_script_is_finished = true; # true|false # # If true, the script will use the file manager shell command specified in # $file_manager_shell_command_to_use to open the pond folder. # Perl might get confused if you don't have this "1;" at the bottom # of this config file. 1;