Pacific-Design.com

    
Home Index

1. Linux

2. Archive

Linux / Archive /

Archive Function for File Versioning


archive() {
    DATE=$(date +"%Y-%m-%d-%H")
    mkdir -p ~/archive
    filename=$(basename "$1")
    echo $filename
    echo "cp $1 ~/archive/$filename.$DATE"
    cp $1 ~/archive/$filename.$DATE
    ls -l ~/archive/
}