- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- help me take backup using cron
Operating System - Linux
1822193
Members
3949
Online
109640
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2007 08:19 PM
04-05-2007 08:19 PM
I can create a backup as
#tar -cvf /var/"$(date +%F)"_tmp.tar /tmp
but cant take backup when using cron
#crontab -e
05 21 * * * /bin/tar -cf /var/"$(date +%F)"_tmp.tar /tmp
why ?
plz help
Regards
#tar -cvf /var/"$(date +%F)"_tmp.tar /tmp
but cant take backup when using cron
#crontab -e
05 21 * * * /bin/tar -cf /var/"$(date +%F)"_tmp.tar /tmp
why ?
plz help
Regards
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2007 10:10 PM
04-05-2007 10:10 PM
Solution
Shalom Maaz,
You are missing the basic idea of cron. No environment. No path, no nothing. The date command probably failed.
There is a cron log in /var/logs
Take this code adn put it int a shell script.
Example:
05 21 * * * /usr/contrib/bin/mybackup > /dev/null
Script:
#!/bin/sh
# set PATH and such so it works.
backkupfilename="/var/$(date +%F)_tmp.tar"
/bin/tar -cvf $backupfilename /tmp
Cron is not the command line. testing it on the command line is useless.
SEP
You are missing the basic idea of cron. No environment. No path, no nothing. The date command probably failed.
There is a cron log in /var/logs
Take this code adn put it int a shell script.
Example:
05 21 * * * /usr/contrib/bin/mybackup > /dev/null
Script:
#!/bin/sh
# set PATH and such so it works.
backkupfilename="/var/$(date +%F)_tmp.tar"
/bin/tar -cvf $backupfilename /tmp
Cron is not the command line. testing it on the command line is useless.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP