Giter Club home page Giter Club logo

backup-manager's People

Contributors

aadlani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backup-manager's Issues

Day number interpreted as Octal

in line 87:

weekNum=$(($archiveDay/7)) 

if archiveDay is "09" it is treated as a base-8 number which is invalid and script fails here. Solution for that is to explicitly say that it is a base-10 number.

weekNum=$(((10#$archiveDay)/7)) 

Some issues

Thank you for this nice script. Some parts of it does not work for me:

  1. On my system, date has no switch -v and -l
    I have to change it like this:
    YESTERDAY=$(date -dyesterday +%Y%m%d) //YYYYMMDD ;
  2. TODAY=${TODAY:0:8} <= shouldn't it be TODAY=${NOW:0:8} and so on?
  3. line 50: find $SNAPSHOT_DIR -type d -mindepth 1 -maxdepth 1 -exec basename {} ; |
    I get this:
    find: warning: you have specified the -mindepth option after a non-option argument -type, but options are not positional (-mindepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.

$find $SNAPSHOT_DIR -mindepth 1 -maxdepth 1 -type d -exec basename {} ; | \
solves it.
4. GNU find command does not have an -E switch
5. /usr/local/bin/gpg <- not the standard path for gpg
Perhaps something like this might help:
// Setting binaries
find=/usr/bin/find
tar=/bin/tar
gpg=/usr/bin/gpg

//These are the commands we actually need for the backup
command_list=(date echo $find grep $gpg hostname sh $tar which)

// Verify that each command we use exists. if one can't be found use $PATH and make a suggestion if possible.
for command in ${command_list[@]}; do
if [ ! -x "which $command 2>&1" ]; then
echo -e "\nERROR: $command not found! "
base=basename $command
if [ "which $base 2>&1 | grep "no \basename $command in"" != "" ]; then
echo -e "ERROR: $base is not in your $PATH."
fi
exit -1
fi
done
(it is part of blinkeye's great mkstage4 script)

best regards,

nik-k

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.