In today's world, data is very valuable. Every action on the computing devices generates data from which value can be derived. For example, large E-commerce companies like Amazon track our activity on their website and generate advertisements and recommendation according to our previous choices. Since data and information is valuable, we must have a secure backup of it for easy recovery in case of data loss. Our main objective in this article is to take backup of a specified folder in Linux by compressing it and storing it in a backup directory.
For Scheduling the backup process, we use Crontab Scheduler. Generally, it is preferred to take backup in remote repositories. Here, the backup folder is created on the Root of the Linux Machine in sudo priviliges which provides security but it can be easily deployed in remote repository.
The backup. Improve this question. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. Add a comment. Active Oldest Votes. This isn't working because the command date returns a string with spaces in it. Wed Oct 16 EDT You're probably thinking of a different string to be appended would be my guess though.
Improve this answer. C shells apparently don't support that notation for subshells. I wold recomment the iso formats anyway. The precision can be specified by adding hours, minutes, seconds, or ns to the parameter -I. Example date -Iseconds. Show 1 more comment. This would work: cp foo.
Gilles 'SO- stop being evil' Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. KalpeshSoni The exact command I posted can't produce this error message. You must have used a different command. Railgun2 Railgun2 1 1 silver badge 4 4 bronze badges. Use a function, it will make your life easier. Your other tries have just wrong syntax Here a possible solution without whitespaces: cp foo. GNU date options: --iso — Ivan Chau. You copy file to backup file whose name is created with appended time stamp cp foo.
Atul Rokade Atul Rokade 71 2 2 bronze badges. What's the advantage of cat with redirection over cp? It is just alternate way to do so — Atul Rokade. Intended output: Improve this question. Benjamin W. Anonymous Entity Anonymous Entity 3, 3 3 gold badges 24 24 silver badges 35 35 bronze badges. Possible duplicate of Append date to filename in linux , Appending a current date from a variable to a filename , Adding timestamp to a filename with mv in BASH , etc.
Add a comment. Active Oldest Votes. Improve this answer. Aleks-Daniel Jakimenko-A. Why not. For example, it will generate: Gianfranco P. Kyle Coots Kyle Coots 1, 1 1 gold badge 17 17 silver badges 23 23 bronze badges.
0コメント