Using shell script to make back up copys

  Kiến thức lập trình

I am trying to make a script for ubuntu, with which I can copy a file to a designated
backup folder. I also tried to create a variable with the current date to include this to the file name. The scripts looks so far as the following:

now="$(data + '%d/%m/%Y')"

cp file.c ./backup/${now}_file.c

When I tried to run it, it says the following:

./backup.sh: 1: data: not found

New contributor

user24349796 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT