Paul Sutton

Backup

Bash scripting 8 – Backup

So moving on, making backups of files is generally a good idea, especially with the scripts we have been making

echo "Basic backup script"
echo
append=-bak # set text to append to file
echo "list files"
echo
ls
echo
for file in *.JPG # apply to all files ending with JPG
do
    filename="${file%.*}"
    cp $file ${filename}.JPG$append
done
echo "backed up files"
ls

Tags

#Bash,#Bashscripting,#BatchProcessing,#Backup


MastodonPeertubeJoin Mastodon

AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay