129 Commits

Author SHA1 Message Date
gahowork 9b3ea2d410 Log to destination (#280) 2025-05-27 13:30:01 +01:00
qinjunjerry 7af3df3644 Update symlink and remove .inprogress only after success (#264) 2023-12-17 18:51:09 +00:00
Laurent Cozic 6664e6c5bc Fixed indentation and white space 2023-12-17 10:16:28 +00:00
Edwin Kofler d14cafde7b fix: Quote $0 and printed variable (#263) 2023-12-13 14:25:04 +00:00
Benjamin 7e3618c514 mod fn_parse_date, mismatch version/syntax of date (#240)
* mod fn_parse_date

combine identical cases, rm oft-failing darwin, subproc syntax

* repair my default spaces to not expand tabs
2021-06-25 16:44:49 +01:00
psmanek 6374c32a95 Update rsync_tmbackup.sh (#232)
Fix: Source path with spaces.
2021-02-28 18:02:59 +00:00
linleybao 88db869fe7 fix typo (#179) 2019-11-05 16:39:26 +00:00
omer-musa-battal da904fe66c File existence and file system type checks (#170)
Added error checking for nonexistent source file.
Also added file system type checks for destination and source, rsync flags are updated accordingly.
2019-09-29 15:57:59 +01:00
kapitainsky 27c56e9690 Fix lock to support more than one backup script running (#163) 2019-09-28 13:32:25 +01:00
Laurent Cozic b460078ab0 Tabs 2019-09-25 22:18:57 +01:00
kapitainsky 48b42bf6ba Fix edge case in backup expiration logic (#166)
* bugfix - fn_expire_backups function

* add BACKUP_TO_KEEP parameter

* correct PREVIOUS_DEST test

* variables case correction for consistency
2019-09-25 22:18:06 +01:00
Laurent Cozic e2b4148855 Removed comment from --rsync-get-flags option 2019-09-06 15:29:31 +01:00
zwotzie 1b4319b827 move rsync flag --compress to ssh section. It will be used only if de… (#159)
* move rsync flag --compress to ssh section. It will be used only if destination is accessed via ssh

* fix identation, use tabs only
2019-08-16 13:44:27 +02:00
DeeeeLAN 72d694d8e4 Added rsync-append-flags method and method to specify id_rsa for ssh (#134)
* added rsync-append-flag method and method to specify id_rsa for ssh

* fixed formatting

* fixed formatting
2019-01-18 12:17:34 +00:00
William D. Jones 487fd112c1 Use NetBSD ps in place of pgrep to determine whether a backup is currently running. 2018-06-13 18:54:57 +00:00
William D. Jones 2ba179ca7d Add NetBSD date parsing. 2018-06-12 13:33:21 +00:00
Neddy70 9f9a4945e2 Merge branch 'expiration-strategy' into no-auto-expire
Merge upstream fixes
2018-03-18 21:54:36 +11:00
Neddy70 b0654c96e0 Added option to disable automatically purging old backups when out of space. 2018-03-17 11:41:14 +11:00
Laurent Cozic 7f1431c13a Fixed date parsing issue 2018-03-05 19:29:14 +00:00
Laurent Cozic c5af8528bb Merge branch 'master' into expiration-strategy 2018-02-24 12:26:46 +00:00
Laurent Cozic 051733df1e Fixed variable names 2018-02-23 18:19:09 +00:00
Laurent Cozic a77169818e Changed order of expiration strategy items 2018-02-23 17:55:12 +00:00
Loki3000 80c4d26573 Fix work with symlink as a destination
https://github.com/laurent22/rsync-time-backup/issues/92
2018-02-23 12:25:36 +03:00
Nathan French bfa1fd092e Fix to assure only one instance is running.
Since this script runs under /usr/bin/env, running 'pgrep $0' will fail
due to it being a child of 'bash'. In order to fix this, pgrep must use
the `-o` flag (oldest pid, or in this case, the leader), and `-f` which
searches the full process name.
2018-01-19 13:42:54 -05:00
Manuel Molina Cuberos 19ecacad25 Newer versions of bash reports OSTYPE differently. This copes with the case. 2017-12-09 11:28:22 +01:00
Manuel Molina Cuberos 31a7bac4b4 Replaced operator '=~' with 'grep -Eq' and using a perl one-liner to avoid 'date -j'. Both are not compatible with Mac OS X Tiger. 2017-12-08 22:20:53 +01:00
Laurent Cozic 2d0cb29bcb Allow specifying the expiration strategy tokens in any order (less error prone) 2017-11-26 16:59:29 +00:00
Laurent Cozic c608793b60 Moved expiration logic to own function and implemented handling of strategy tokens 2017-11-26 16:48:03 +00:00
Matthias Kern c5c1307062 Introduces function that parses the --strategy option into a two dimensional array 2017-11-24 20:16:22 +01:00
Thomas McWork 260715a9b9 Also detect single dashes as error
This also recognizes single dashes as invalid input:

    rsync_tmbackup.sh - 1 2 3

Expected output: an error because it's unknown what the single `-` could mean

Actual output:

    rsync_tmbackup: Safety check failed - the destination does not appear to be a backup folder or drive (marker file not found).
    rsync_tmbackup: If it is indeed a backup folder, you may add the marker file by running the following command:
    rsync_tmbackup: 
    rsync_tmbackup: mkdir -p -- "1" ; touch "1/backup.marker"
    rsync_tmbackup:
2017-11-17 10:20:50 +01:00
Laurent Cozic 4393a86bd0 Merge pull request #90 from markalston/master
Added ability to pull files from remote ssh server
2017-09-26 15:08:36 +01:00
Wietse Franssen dfeafb3d9f fixed check for previous backups in zsh 2017-09-22 15:23:46 +02:00
markalston 5a8ed7b008 Update rsync_tmbackup.sh 2017-09-20 10:54:52 -06:00
markalston 13357c1cc9 fixes for ssh source folder / 2017-09-20 10:40:34 -06:00
markalston 6b05dca48a fixed missing SSH_SRC_FOLDER_PREFIXs 2017-09-20 09:36:36 -06:00
markalston 88dce0e3f9 Updated rsync_tmbackup.sh to allow remote source
Changes to allow rsync_tmbackup.sh to pull files from remote server.
2017-09-20 09:22:18 -06:00
Laurent Cozic 9a5afa66f4 Merge pull request #76 from SimonHeimberg/patch-1
do not search for directories recurisve
2017-06-08 14:02:44 +01:00
Simon Heimberg db316ed18e correct argument for maxdept parameter 2017-06-08 14:51:59 +02:00
Laurent Cozic 8ef83da5d9 Reverted to use rm for directory deletion 2017-06-04 11:25:52 +01:00
Laurent Cozic b41589ec77 Only use optimised deletion method for large directories 2017-06-03 15:31:48 +01:00
root dbc2f536fa Add support for checking if the previous backup is still running under cygwin 2017-05-18 20:04:31 -04:00
Laurent Cozic d152279d30 Still delete inprogress file in case of error or warning 2017-05-08 20:14:15 +00:00
SimonHeimberg 6364fe1ca0 correct position for maxdept parameter
as suggested by the output of find
2017-05-04 14:55:32 +02:00
SimonHeimberg 41f9bd1c8c do not search for directories recurisve
This gives a big speed improvement when the dest dir contains other directories containting many subdirectories.
2017-05-04 14:49:30 +02:00
Laurent Cozic 15329de603 Changed order of error/warning handling to avoid redundant error messages.
Displayed grep command that can be copied and pasted to investigate backup issues.
2017-05-02 21:14:22 +00:00
Laurent Cozic 77d8c56000 Added --stats --human-readable to default rsync flags, and done minor clean up and refactoring 2017-05-02 21:58:01 +00:00
Laurent Cozic f9205f6e20 Allow setting log file directory 2017-05-02 20:14:36 +00:00
joekerna dff1ea00e1 rsync doesn't work with files
Use rsync only to delete directories and stick to rm for files.
2017-04-19 10:01:30 +02:00
joekerna 78d7121586 Improve backup removal (Issue #55)
Implemented quicker removal of old backups according to issue #55
2017-04-18 14:48:40 +02:00
Laurent Cozic 756b03bc32 Fixes issue #59 - script didn't work when source set to '/' 2016-11-29 12:29:07 +00:00