about summary refs log tree commit diff stats
path: root/leo.pl
Commit message (Collapse)AuthorAgeFilesLines
* Add option to exclude pathsAndinus2020-10-121-14/+32
|
* Remove obsolete code, add extra config optionsAndinus2020-10-111-14/+17
|
* Switch config, simplify script, make paths relative to '/'Andinus2020-10-081-32/+50
|
* Get $backup_dir from config, format $mday with 2 leading zerosAndinus2020-10-081-6/+9
| | | | | This will not work with previous configs. But that's fine because I'm the only one using this.
* Change default backup directoryAndinus2020-09-031-1/+1
|
* Fix logical errorAndinus2020-09-021-2/+4
| | | | | There are still issues with this, for example the user can't pass ``documents/text.txt'' or anything in sub-directory.
* Create profiles on the flyAndinus2020-09-021-1/+6
|
* Move configuration to a config fileAndinus2020-08-311-22/+9
| | | | | I'll switch to some other config format later, this format is not safe at all!
* Fix options checkingAndinus2020-08-311-4/+6
| | | | options passed via arguments were being ignored.
* Add fortunes directory to profileAndinus2020-08-281-2/+3
|
* Change mentions of "archive" to "backup"Andinus2020-08-271-13/+13
| | | | | | | | This is a backup program now. By archive I think of something else, like I archive web pages to save them offline. And by backup I think of storing files safely somewhere so that we can restore it later. Doesn't matter.
* Remove date from archive files, add date to archive directoryAndinus2020-08-271-2/+2
| | | | | This format is better than keeping lots of files in a single directory.
* Add help option, update documentation to explain new profilesAndinus2020-08-271-3/+4
|
* Fix help message, switch to %profile from dispatch tablesAndinus2020-08-271-61/+46
| | | | | | | Now we can use aliases again, no dispatch table required, help is generated automatically & configuration looks much simpler. We can still have special profiles like I've created for journal directly when calling archive().
* Make all paths relative to $HOME, add emacs & config to dispatchAndinus2020-08-271-30/+20
| | | | | | | I'm trying to make it easier to print help message, I don't want to print it manually. After this I'll just turn the dispatch table into just table which contains all the paths to be archived & then I'll be able to print help nicely.
* Remove aliases, move to a different functionAndinus2020-08-271-6/+20
| | | | | | Problem with aliases was that profile name would still be say `.ssh' for ssh which means the archive created will be `.ssh-...tar' which is not what I wanted.
* Add several paths to dispatch table, simplify table generationAndinus2020-08-271-15/+17
| | | | | | | | | | | | | | | | | | I added a lot of things to profile, there was a lot of repetition in dispatch table so I moved it to a function. Aliases were used for inconvenient paths but I could've done this too: my %directories = ( ssh => "$ENV{HOME}/.ssh", pass => "$ENV{HOME}/.password-store", ); foreach my $dir (sort keys %directories) { $dispatch{$dir} = sub { archive("$archive_dir/${dir}_${ymd}.tar", "-C", "$directories{$dir}", "."); }; }
* Add environment variables for some optionsAndinus2020-08-271-0/+4
|
* Print Encrypted/Signed status , don't encrypt journalAndinus2020-08-271-1/+7
| | | | My journal is already encrypted so don't encrypt it again.
* Parse @ARGV to catch all argumentsAndinus2020-08-271-7/+10
| | | | | Now the user can run ``leo pass journal'' & both will be archived, previously `journal' would've been ignored.
* Push receipient only when encrypt option is passedAndinus2020-08-271-2/+3
| | | | | | | Fixes this error: gpg: WARNING: recipients (-r) given without using public key encryption
* Fix deletion, check $? for gpg2Andinus2020-08-271-3/+8
| | | | | Maybe I should delete the tar file by default & add a `nodelete' option.
* Add delete optionAndinus2020-08-271-1/+6
| | | | This will remove the archive after running gpg2.
* Add gpg2 function to Encrypt/Sign archivesAndinus2020-08-271-5/+21
|
* Add missing semicolonAndinus2020-08-271-1/+1
|
* Move tar_create, tar_list & ymd to the endAndinus2020-08-271-17/+17
| | | | These will mostly remain unchanged so I moved them to the end.
* Restructure code, rename tar_create to archiveAndinus2020-08-271-44/+41
| | | | | Moved @ARGV parsing & HelpMessage sub to the end. tar_create is now a simple wrapper around `/bin/tar'.
* Move archive dispatch table to mainAndinus2020-08-271-63/+47
| | | | | | I'm thinking of making leo as my archive program instead of a meta-program to hold all my scripts. It's simpler to keep them seperated, meta-program would've been complex.
* Add encrypt & sign option, remove archive_HelpMessage()Andinus2020-08-271-17/+21
| | | | | | | | | | | | | | | | | | | `archive_HelpMessage' was removed because variables from `archive' sub are not shared with it. On #perl@freenode: <andinus> i have a sub archive_Help inside of sub archive, when i try to use archive's var in archive_Help perl says "Variable "$archive_dir" will not stay shared at..." [02:55] [...] <Grinnz> generally, you pass variables into subs that you call [02:57] <Grinnz> defining a sub within another sub is evidence that you did it wrong [...] <andinus> is defining a sub within a sub not a good idea? <Grinnz> it does nothing useful [03:01] <Grinnz> and causes issues like the one you are having [...]
* Warn if $tar_file existsAndinus2020-08-271-1/+4
| | | | | "might overwrite" because I don't know what happens if tar fails, maybe it leaves the file untouched (?).
* Add pass to archive listAndinus2020-08-271-1/+7
| | | | | `pass' will archive `.password-store' directory which holds my passwords.
* Add ssh to archive list, add date in tar file namesAndinus2020-08-271-3/+21
| | | | | | | | Date was added in `yyyy-mm-dd' format because it'll be easier to manage these archives later. `ssh' was added to archive list, it archives `$ENV{HOME}/.ssh' directory.
* Remove repetition, move checks to tar_create()Andinus2020-08-271-15/+30
| | | | | | This does make tar_create() complex & confusing but that's okay because otherwise there would've been lots of repetition in program as I added more definied archive paths.
* Remove unused files/modules, add archive subAndinus2020-08-251-2/+68
| | | | `archive' will create tars of files, there is a pre-defined list.
* Remove unused code, Term::ANSIColorAndinus2020-08-251-23/+13
| | | | | I moved these to a shell scripts again because it's much simpler. Term::ANSIColor is not really required.
* Shorten option lengthAndinus2020-07-041-2/+2
| | | | `sync emacs irclogs' was too big, now it's `sync irclogs'.
* Sync irclogs, seperate sync optionsAndinus2020-07-031-1/+3
| | | | | By default it syncs only the config now & the user has to mention `irclogs' or `authinfo' to sync them.
* Add syncemacs functionAndinus2020-07-031-0/+35